You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used the search to make sure that a similar issue hasn't already been submit
Detailed Description
I have a rather peculiar use-case, and I'm didn't find anything in the Issues about this already. It feels like it's not a best-practice, so if tsoa doesn't support it, I don't blame you. ;)
I have an API endpoint that needs two rather different response schemas, dependent on what one of the query parameters (a clientId) to the endpoint is. Because the schema is dependent on which clientId you pass the endpoint, I don't want to display both options of schema in the documentation that the user sees, because users with the special-cased clientId don't need to see the generic response schema, and users with the generic response schema don't need to see the special-cased schema for some other clientId.
The API and documentation are currently divided, and I'm able to manipulate the Swagger API specification based on the clientId connected to the user viewing the documentation, so that when their clientId is X, they see the special-cased schema for the endpoint, and when their clientId is not X, they see the generic schema. I do not want to end up creating multiple endpoints for each client that needs a change to the schema; I want to continue using a single endpoint with different response schemas based on the clientId.
In order to unify the API code and docs with tsoa, I'd need a way to replicate this multi-schema endpoint model. Is there a way to do this natively in tsoa, or would I need to add some sort of post-processing step to tsoa's output in order to accomplish this?
The text was updated successfully, but these errors were encountered:
Sorting
I'm submitting a ...
I confirm that I
Detailed Description
I have a rather peculiar use-case, and I'm didn't find anything in the Issues about this already. It feels like it's not a best-practice, so if tsoa doesn't support it, I don't blame you. ;)
I have an API endpoint that needs two rather different response schemas, dependent on what one of the query parameters (a clientId) to the endpoint is. Because the schema is dependent on which clientId you pass the endpoint, I don't want to display both options of schema in the documentation that the user sees, because users with the special-cased clientId don't need to see the generic response schema, and users with the generic response schema don't need to see the special-cased schema for some other clientId.
The API and documentation are currently divided, and I'm able to manipulate the Swagger API specification based on the clientId connected to the user viewing the documentation, so that when their clientId is X, they see the special-cased schema for the endpoint, and when their clientId is not X, they see the generic schema. I do not want to end up creating multiple endpoints for each client that needs a change to the schema; I want to continue using a single endpoint with different response schemas based on the clientId.
In order to unify the API code and docs with tsoa, I'd need a way to replicate this multi-schema endpoint model. Is there a way to do this natively in tsoa, or would I need to add some sort of post-processing step to tsoa's output in order to accomplish this?
The text was updated successfully, but these errors were encountered: