Add decorator to allow specification of the schema type name
See original GitHub issueI’m submitting a…
[ ] Regression
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
The Open API schema type name is the same as the type name.
Expected behavior
Add a decorator to allow specification of a schema type name that is different from the type name.
For example:
@ApiSchema({ name: 'MyType' })
class MyTypeDto {
}
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Type names often have suffixes such as Entity
or Dto
that represent internal
implementation choices. Allowing explicit specification of the schema type name
would avoid leaking these choices into the public interface.
Environment
Nest swagger version: 4.5.12
For Tooling issues:
- Node version: 12.13
- Platform: Mac
Others:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
GraphQL schema decorators
Schema decorators will allow you to do both of these things and more! ... You can create custom types and combine them into...
Read more >OpenAPI Decorators | LoopBack Documentation
The model decorators allow type information of the model to be visible to the spec generator so that @requestBody can be used on...
Read more >typestack/class-validator: Decorator-based property ... - GitHub
Allows use of decorator and non-decorator based validation. Internally uses validator.js to perform validation. Class-validator works on both browser and node. ...
Read more >Decorators | tsoa - GitHub Pages
The @Security decorator can be used above controller methods to indicate that there ... OpenAPI allows you to deprecate operations, parameters, and schemas....
Read more >Decorators | Sanic Framework
The primary mechanism for adding content to your schema is by ... The @openapi.definition decorator allows you to define all parts of an ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
May I try?
Let’s track this here https://github.com/nestjs/swagger/pull/983