jsonapi-suite / jsonapi_compliable

MIT License
20 stars 35 forks source link

Add api_version option #145

Open sideshowbandana opened 5 years ago

sideshowbandana commented 5 years ago

Allow users to specify an api version when generating an api resource.

richmolj commented 5 years ago

Thanks @sideshowbandana, this is great! ❤️

A few things to consider: the 1.0 version of JSONAPI Suite is Graphiti (I'll be swapping over next week). That's where all active development is happening. I'm OK merging this, but we'd want the same in Graphiti.

Also, we have the concept of an "api namespace", which in Graphiti would mean foo_api/v1. This is saved to graphiticfg.yml so it can be re-used each time. It would be nice to ensure these concepts play nicely together - maybe pass the whole namespace?

sideshowbandana commented 5 years ago

Cool. I'll check out Graphiti. Happy to take a pass at adding the functionality there as well. As far as the namespace stuff, would you like namespace to default to api/v1 and allow the user to specify --namespace /myapi/v2?

richmolj commented 5 years ago

Yeah, that sounds about right. The behavior in Graphiti right now is that if there isn't already a namespace in the config, it will prompt you to enter one. What's missing is the command-line override.

Also keep in mind I believe this went from api/v1 to /api/v1 as the default in move to Graphiti.