Hidden Controller referencing model should not generate model
See original GitHub issueFirst of all, we love using tsoa. Thank you!
Today, when a hidden controller references a model / schema, it is included in the final output. This does not seem like it would be intended behavior.
Sorting
-
I’m submitting a …
- bug report
- feature request
- support request
-
I confirm that I
- used the search to make sure that a similar issue hasn’t already been submit
Expected Behavior
When running yarn tsoa spec
, you should get this:
components:
examples: {}
headers: {}
parameters: {}
requestBodies: {}
responses: {}
schemas: {}
securitySchemes:
basic:
scheme: basic
type: http
info:
title: api
version: 0.1.0
contact: {}
openapi: 3.0.0
paths: {}
servers:
-
url: /v0
Current Behavior
When running yarn tsoa spec
, you get this:
components:
examples: {}
headers: {}
parameters: {}
requestBodies: {}
responses: {}
schemas:
TestPayload:
properties:
key:
type: string
required:
- key
type: object
securitySchemes:
basic:
scheme: basic
type: http
info:
title: api
version: 0.1.0
contact: {}
openapi: 3.0.0
paths: {}
servers:
-
url: /v0
Possible Solution
Ideally, it would be possible to use @Hidden on the model or the @ignore
jsdoc, but neither seem to work for me.
Steps to Reproduce
Controller example:
import { Hidden, Route, Controller, Get } from 'tsoa';
type TestPayload = {
key: string;
};
@Hidden()
@Route('test')
export class TestController extends Controller {
@Get()
async route(): Promise<TestPayload> {
return {
key: 'value',
};
}
}
Context (Environment)
Version of the library: Version of NodeJS:
- Confirm you were using yarn not npm: [x]
Detailed Description
Should not find any metadata from hidden controllers
Breaking change?
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Compile error in hidden module: <module name>
The error is raised when a compilation error exists in the VBA code inside a protected (hidden) module. The specific compilation error is...
Read more >Hide a Request Field in Swagger API - Baeldung
We can use the hidden property of the annotation to hide a field in the definition of a model object in Swagger UI....
Read more >Using OpenAPI and Swagger UI - Quarkus
This guide explains how your Quarkus application can expose its API description through an OpenAPI specification and how you can test it via...
Read more ><model-viewer> Examples and Documentation
This attribute controls when the model should be revealed. If reveal is set to "auto", the model will be revealed as soon as...
Read more >F.A.Q - Springdoc-openapi
Can springdoc-openapi generate API only for @RestController ? ... The property springdoc.model-converters.pageable-converter.enabled is only available since ...
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
@marcusglowe The feature you want is,
Hiding models which been use in a Hidden controller
?I’m planning to send a PR about this.
I think we need discuss more detail about this, and find out some way to implement this.
Yes that’s right!