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

Adding version to path only possible via configuration key 'version'? #403

Closed
cank opened this issue Apr 29, 2016 · 7 comments
Closed

Adding version to path only possible via configuration key 'version'? #403

cank opened this issue Apr 29, 2016 · 7 comments

Comments

@cank
Copy link

cank commented Apr 29, 2016

This is for grape-swagger (0.20.2).

Not sure if this is a bug or an undocumented configuration option, but I am unable to get the version to correctly appear in the JSON file under 'paths' unless I do the following:

add_swagger_documentation(
  version: 'v1',
  add_version: true,
)

This will produce:

"paths": {
  "/api/v1/experiments": {
  }
}

The configuration instructions in README.md lists api_version as a configuration option, but not version. This is clearly the intended behavior as shown here:

if options[:version] && options[:add_version]

and in tests here:

https://github.com/ruby-grape/grape-swagger/blob/master/spec/lib/path_string_spec.rb

Should the documentation be updated to reflect this?

@dblock
Copy link
Member

dblock commented Apr 29, 2016

Yes definitely. This is probably something that was added recently by @LeFnord. Thanks for contributing!

@LeFnord
Copy link
Member

LeFnord commented Apr 29, 2016

thanks for pointing …

@LeFnord
Copy link
Member

LeFnord commented Apr 30, 2016

have a look on it … #405

@LeFnord LeFnord closed this as completed Apr 30, 2016
@LeFnord
Copy link
Member

LeFnord commented Apr 30, 2016

corrected behaviour:

  • version of the API, also used in a path would be taken from grape version
  • the documentation version could be set via doc_version

this could be confusing, but I think the intention of that is, one have a gem/engine, where the API would be implemented, this could be a semantic version, and should also be documented …

@ZeroInputCtrl
Copy link

the add_swagger_documentation version should be in the upgrade guide as it used to be api_version.

@dblock
Copy link
Member

dblock commented Jun 23, 2016

@BaneOfSerenity I think you make a good point, would you please contribute?

@ZeroInputCtrl
Copy link

@dblock would be glad to, i should have something by the end of the day. ^.^

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

No branches or pull requests

4 participants