-
Notifications
You must be signed in to change notification settings - Fork 255
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
Add tags to swagger specification #226
Comments
That sounds great! If the PR had tests to cover the change, I'd definitely welcome it! The only other thing I'd want to investigate is whether or not an endpoint can/should support multiple tags. And how we resolve errors if the referenced |
Perfect! I'll make sure to add proper testing. For the I'll come back with a concrete proposition on how to handle it. |
Yup! That sounds right to me. I'd hope to follow Swagger's lead on this one and support whatever they support. |
I implemented the functionality, still need to add some proper tests. Current implementation works like this @apiTitle Tags Example
@apiTag name1 description1
@apiTag name2 description2
#* Example endpoint with one tag
#* @tag name1
function() {}
#* Example endpoint with multiple tags
#* @tag name1
#* @tag name2
function() {}
#* Example endpoint with unmatched tags
#* @tag randomName
function() {} Couple of notes:
Any feedback before I writing some tests? |
Looks like a good start to me!
Tl;dr: looks good! |
Cool! I've added a commit (e1c1f42) that would allow for tag names with whitespaces. You would just use 'underscores ' to indicate spaces. During parsing I Minimal example: #* @apiTitle Tags Example
#* @apiTag name_with_whitespace description1
#* Example endpoint with one tag
#* @tag name_with_whitespace
function() {} which would be displayed in swagger-ui as "name with whitespace" |
Closed by #230 |
I would like to make use of the tags to group operations as described in the swagger docs here.
In plumber I'd like to do something like this:
Looking into the codebase I believe this would require two changes:
prepareSwaggerEndpoints
inswagger.R
to extract the@tags
decorator on the endpointsparseOneGlobal
inparse-globals.R
to extract the@apiTag
decorators that hold the name and description of each tag similiar to how@param
gets parsed on endpointsWould you accept a pull request to add this functionality?
The text was updated successfully, but these errors were encountered: