-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
Waiting on https://www.traviscistatus.com/incidents/lxq2zxskjyf1 to be resolved before merging this. |
lib/rspec/rails/swagger/helpers.rb
Outdated
@@ -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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 🎉🎉🎉
e05d1bd
to
5c49320
Compare
Standardize the naming while we're at it.
Fixes #43 by allowing the document to be specified in a parent context.
In the process changes the
swagger_document
name toswagger_doc
to match the name used in the configuration file.