简体   繁体   中英

Rails API versioning

I am trying to implement api versioning the Railscasts #350 way (no gem). Is there a way to create only updated resources in new version and not entire set of controllers and views(jbuilder) with fallback to latest supporting version functionality? I am using the accept header with "scope model:" without namespaces. Thank you.

You should not version only part of a resource eg create. What will happen is you'll have dependencies created and your views and controllers only know 1 version of the resource. This can lead into problems in the future. You should do a default version if non is provided.

Best practices for API versioning?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM