ruby-grape / ruby-grape/grape-swagger
Accept lambda/proc in security definitions for relative urls
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
For example:
security_definitions: {
ResourceOwner: {
type: 'oauth2',
description: 'OAuth 2 with the password grant flow',
flow: 'password',
tokenUrl: -> {|request| "#{request.host}/api/v1/oauth/token"}
}
}
When using Swagger UI, it can allow a relative URL, but it really needs an absolute URL to point to the same server that enables authorizations.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by locating the security_definitions handling for tokenUrl, then reproduce the shown Proc or lambda example and check that the generated Swagger UI authorization URL is absolute and points to the same server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100