You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API versioning is a requirement when working with API, it gives control over the Response representation and allow improvement of both backend and clients without breaking things.
However, it is a tricky question, and there are best practices as well as real-life use case.
Therefore, there may be no "correct solution" for this.
I may recommend a ApiVersionStrategy utility, implementing the Strategy pattern to decide how to work with version in an uniform way.
The ApiVersionStrategy are free to be implemented by end-developers but we may provide a basic subset of common case like uri versioning, Accept versioning, etc.
The ApiVersionStrategy would generate an ApiConstraint which would be available to in a uniform and consistent way to decide of the implementation.
Depending on the rest of the implementation it may takes place in the Routing module.
The text was updated successfully, but these errors were encountered:
I have too admit I'm not an expert about this. But ocramius' idea was to simply set the serializer according to the version. So basically, in your mapping, you could do something like this:
API versioning is a requirement when working with API, it gives control over the Response representation and allow improvement of both backend and clients without breaking things.
However, it is a tricky question, and there are best practices as well as real-life use case.
Therefore, there may be no "correct solution" for this.
I may recommend a
ApiVersionStrategy
utility, implementing theStrategy
pattern to decide how to work with version in an uniform way.The
ApiVersionStrategy
are free to be implemented by end-developers but we may provide a basic subset of common case like uri versioning,Accept
versioning, etc.The
ApiVersionStrategy
would generate anApiConstraint
which would be available to in a uniform and consistent way to decide of the implementation.Depending on the rest of the implementation it may takes place in the Routing module.
The text was updated successfully, but these errors were encountered: