-
Notifications
You must be signed in to change notification settings - Fork 229
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
support multiple tags as an array and in definition #30
Conversation
* /login: | ||
* post: | ||
* description: Login to the application | ||
* tag: [Users] | ||
* tag: [Users, Login] |
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.
Does this support yaml array syntax?
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.
@drGrove Yes it does.
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.
@efmr, would you mind writing a test for this so we make sure that we don't get a regression in the future?
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.
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.
Thanks @efmr, I'll merge this tonight unless @chdanielmueller says otherwise.
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.
@drGrove fine with me
Hi. First, great work here. This project is very nice. I've noticed that you are using |
Hi @cguedes, I looked now at the "Operation Object of swagger spec" link, yes, you're correctly pointing out that the final output has to have the tags property (plural) |
TLDR: I'm talking about example files. There are two places where tags are defined in the swagger spec. The list of all tags:
info: {
'title': 'Hello Word',
'description': 'This is a sample server Petstore server.',
},
tags:[
{
'name': 'user',
'description': 'User APIs'
},
{
'name': 'setting',
'description': 'Setting APIs'
}
],
basePath: '/api'
} This is ok.
This second should be defined per API using JSDOC with the following: /**
* @swagger
* /login:
* post:
* description: Login to the application
* tags: [Users, Login]
* produces:
* - application/json
*/ instead of /**
* @swagger
* /login:
* post:
* description: Login to the application
* tag: [Users, Login]
* produces:
* - application/json
*/ At the moment you are not validating this, so people can change, but following the example they may end up with issues regarding this change (like myself). |
I suggest you create a separate issue on this subject. There is definitely a point to keeping the jsdoc as similar as possible to the specification it produces. Wouldn't this also apply to other properties such as |
Allow to set multiple tags in jsdoc with as an array
It will allow definition of tags in swagger definition and will merge with others in the jsdoc.