-
Notifications
You must be signed in to change notification settings - Fork 470
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
accepting proc for options #441
Conversation
b62baa4
to
3eea1f6
Compare
updates readme and changelog
@@ -216,6 +220,8 @@ add_swagger_documentation \ | |||
base_path: '/super/api' | |||
``` | |||
|
|||
`host` and `base_path` are also accepting a `proc` or `lambda` |
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.
Make it into a full sentence, like "The host
and base_path
options also accept ..".
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.
In addition to that, I think providing some trivial usage example would be super helpful in the docs here:
add_swagger_documentation(
base_path: proc { |foo| foo.host =~ /^example/ ? '/api-example' : '/api' }
)
I am going to merge this, my comments are more like next steps. We can still change things wrt my arity comment, but I'd be ok with shipping it as is too. |
yeap … good point |
Sure, thanks for addressing this; I left a small comment suggesting we have a usage example for the |
@Lordnibbler do PR that! |
Sure |
accepting proc for options
this solves #429
host
andbase_path
acceptsString
,proc
orlambda