Closed Omri-Levy closed 7 months ago
Thanks for reporting! This isn't expected behavior for sure so I'll definitely look into this. Most of the heavy lifting is being done by the NestJs ApiParam
decorator. This library just passes on the typebox schema (which is just a JSON schema object at runtime) so it could be a problem downstream somewhere. I'm fairly positive this used to work so I'll have to do some experimentation on my end to see when/where its breaking down.
So quick followup - I just took a look at a generated openapi file for one of my projects and both the example and description are coming through as expected for request params. This is on typebox@0.32.15
, nestjs-typebox@3.0.0-next.7
, and @nestjs/swagger@7.3.0
.
Which versions of the above packages are you on? Could you also post what the generated openapi file looks like for your examples above? At this point, all signs are pointing to some kind of legacy bug / version incompatibility or possibly the swagger UI generator itself.
Hey, I am using the same version for each of the packages you've listed. Here's the generated openapi file.
{
"openapi": "3.0.0",
"paths": {
"/{id}": {
"post": {
"operationId": "AppController_create",
"summary": "",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"description": "The id of the user",
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
}
}
}
},
"info": {
"title": "Cats example",
"description": "The cats API description",
"version": "1.0",
"contact": {}
},
"tags": [
{
"name": "cats",
"description": ""
}
],
"servers": [],
"components": {
"schemas": {}
}
}
Hey, thanks for everything! The packages had ^
in their versions. The moment I removed the ^
it worked. Thanks for a great library. 🙂
Description
Missing fields from OpenAPI generation such as
description
orexample
,name
is used as the description, ifexample
is specified then its used as a description.How it was reproduced
HttpEndpoint
decoratordescription
andexample
example
Withoutexample
Thanks a lot for the package, your time, and your work. Please let me know if there is any more information I can provide. 🙏🏼