Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to document versioned APIs when routes are not used to implement versioning #48

Open
midas opened this issue Apr 7, 2019 · 1 comment

Comments

@midas
Copy link

midas commented Apr 7, 2019

First and foremost, thank you for your work on this library! It has been crucial in my API development.

I am using custom mime-types in the Accept header as the manner by which I version my API. For instance: application/vnd.my-app.v1+json. A plug detects the custom mime-type and sets a value in the conn to the mapped version number, something like: :v1. Then the controller, views, etc can pattern match on the conn version value to fork with different behaviors. For more info on this technique see this blog post.

Due to this API versioning implementation, it seems I am forced to document all API versions within the same file. Obviously, this makes the versions of the API harder to grok.

It would be nice if there was a way for me to generate my API version docs to different files even though the same module is implementing them.

Maybe you already know of a way to accomplish this with no changes to bureaucrat? If not, this could possibly be accomplished through:

  1. Configuring the output READMEs to be dependent on the test file and not the module under test
  2. Providing configuration options for the module under test that could look at something in the conn and send the output to a different configured file

What are your thoughts? Thanks again!

@OpakAlex
Copy link
Member

OpakAlex commented Jan 6, 2020

This is good idea, i can help you with PR if you still need this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants