nebo15 / multiverse Goto Github PK
View Code? Open in Web Editor NEWElixir package that allows to add compatibility layers via API gateways.
Home Page: https://hex.pm/packages/multiverse
License: MIT License
Elixir package that allows to add compatibility layers via API gateways.
Home Page: https://hex.pm/packages/multiverse
License: MIT License
README states you can use :latest and :edge channels as away of controlling the versions. However, :edge doesn't exist in ~> 2.0.0.
Possible values are :latest and :oldest
** (ArgumentError) invalid Multiverse.Adapters.ISODate :default_version config value, possible values: :latest, :oldest, got: :edge
lib/multiverse/adapters/iso_date.ex:44: Multiverse.Adapters.ISODate.init/2
lib/multiverse/adapter.ex:68: Multiverse.Adapter.compile_config!/2
lib/multiverse.ex:60: Multiverse.init/1
Right now conn.resp_body
in response mutator would have IO list with a JSON-encoded response. We need a way to process the response without decoding it in each response change.
Would be nice to have a version header in the response.
If no version was specified, I'd default to the latest one (but not the latest date, the latest date specified in the gate configuration).
If a version was specified or the error callback loaded a different version, then I'd display that (good sanity check for users that they actually got the version they requested).
Whenever gateway is applied, it's responsibility of the package user to identify on which endpoints it should run, but it would be much nicer to be able to use route matching there, like this:
# No method means all methods
mutate_request "/plans/:id" do
end
# Only for GET requests
mutate_request :get, "/plans" do
end
mutate_response "/plans/:id" do
end
mutate_response :get, "/plans" do
end
Additional benefit is that gate would be self-documenting in a way that it's easy to see all changes per endpoint and even to generate simple changelog for them.
TODO:
.formatter.exs
so that they won't be wrapped in brackets.its not clear from the docs or readme whats the best way to mutate response in response_handler. can someone please guide me or add this in README. thanks
Whenever you write code it's hard to tell which on date your version will be released, so it's a good idea to move version date to environment, thus DevOps can manage release date automatically without re-building code.
class VersionChanges
VERSIONS = {
'2017-05-25' => [
Change::AccountTypes,
Change::CollapseEventRequest,
Change::EventAccountToUserID
],
'2017-04-06' => [Change::LegacyTransfers],
'2017-02-14' => [
Change::AutoexpandChargeDispute,
Change::AutoexpandChargeRule
],
'2017-01-27' => [Change::SourcedTransfersOnBts],
...
}
end
That way one version change can be composed of several smaller transformations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.