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

Standardize on swagger_doc naming #45

Merged
merged 2 commits into from
Apr 5, 2019
Merged

Standardize on swagger_doc naming #45

merged 2 commits into from
Apr 5, 2019

Conversation

drewish
Copy link
Owner

@drewish drewish commented Apr 1, 2019

Fixes #43 by allowing the document to be specified in a parent context.

In the process changes the swagger_document name to swagger_doc to match the name used in the configuration file.

@drewish
Copy link
Owner Author

drewish commented Apr 1, 2019

Waiting on https://www.traviscistatus.com/incidents/lxq2zxskjyf1 to be resolved before merging this.

@@ -45,7 +45,7 @@ def path template, attributes = {}, &block
#TODO template might be a $ref
meta = {
swagger_object: :path_item,
swagger_document: attributes[:swagger_document] || RSpec.configuration.swagger_docs.keys.first,
swagger_document: attributes[:swagger_document] || default_document,
Copy link

@zddhub zddhub Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 👍 🥇

Would you like to use swagger_doc instead of swagger_document to align with rswag? or add usage in readme is good thing as well

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll keep the current naming just because it's currently getting past to child contexts that way and it'd be a little weird having two different names for it. Adding to the docs is a good idea though.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah seeing what you're saying in #43 about

# By default, the operations defined in spec files are added to the first

and the config using the swagger_docs name... it would make sense to pick one. I think it makes sense to change that and then bump the version to indicate the compatibility break.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty great work! Thanks @drewish. 👍 👍 👍, You made my life easy. Hope it would be released soon. 🎉🎉🎉

@drewish drewish force-pushed the overide-doc branch 3 times, most recently from e05d1bd to 5c49320 Compare April 2, 2019 14:44
@drewish drewish changed the title Use parent context's swagger_document Standardize on swagger_doc naming Apr 2, 2019
@drewish drewish merged commit aba8588 into master Apr 5, 2019
@drewish drewish deleted the overide-doc branch April 5, 2019 14:10
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

Successfully merging this pull request may close these issues.

2 participants