-
Notifications
You must be signed in to change notification settings - Fork 474
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 decorator to allow specification of the schema type name #983
Add decorator to allow specification of the schema type name #983
Conversation
You can use @ApiSchema to set a custom schema name. Custom schema names are not inherited.
You can use @ApiSchema to set a custom schema name. Custom schema names are not inherited.
Thanks! Could you create a PR to the docs as well? https://github.com/nestjs/docs.nestjs.com |
Ok, will do! |
@kamilmysliwiec here is the PR for documentation update |
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.
LGTM
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.
Have a question on the docs PR.
@nartc I haven't noticed any question there. Can you link it here, please? |
When do you plan to merge and release it ? |
I can't wait for merge and release it! |
This PR is very helpful. When you guys are plan to merge and release it? |
Can we release this soon please? It's been ready for quite a while now. There are other useful features that can be built on top of the ApiSchema decorator once this is merged (documentation at the type level). |
It looks like this branch has merge conflicts - is this all that remains to be fixed? I'm willing to assist to help get this merged. |
@adworacz I doubt the maintainer of this project wants to merge this PR/functionality. If he wanted he would have merged it when it was all green. |
Ignore merge conflicts, I'll resolve them when I get to this PR. |
You can use @ApiSchema to set a custom schema name.
Custom schema names are not inherited.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently when creating schema for a class the class name is taken as the schema name.
Issue Number: N/A
What is the new behavior?
A new decorator has been introduced: @ApiSchema. Using this decorator you can define custom schema name different from the class name.
e.g.
@ApiSchema({name: 'User'})
class UserDto {}
will produce a schema with name User, not UserDto.
Does this PR introduce a breaking change?
Other information