This pull request addresses an issue where the Swagger plugin for ElysiaJS was not effectively merging custom components provided at the application level.
{
"openapi": "3.0.3",
"info": {
"title": "Endpoint Documentation",
"description": "A very good description.",
"version": "1.0.0"
},
"components": {
"schemas": {
} ❌ Wheres our schema?
❌ Where's our securitySchemes?
},
"paths": {
// rest of json
},
With this fix, the plugin now correctly merges the user-defined components from the documentation configuration with the default schemas from app.meta.defs. This ensures that all user-defined Swagger components are accurately reflected in the generated documentation.
{
"openapi": "3.0.3",
"info": {
"title": "Endpoint Documentation",
"description": "A very good description.",
"version": "1.0.0"
"components": {
"schemas": { ✅ Schema is present
"User": {
"description": "string"
}
},
"securitySchemes": { ✅ securitySchemes is present
"JwtAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT",
"description": "Enter JWT Bearer token **_only_**"
}
}
},
"paths": {
// rest of json
},
This pull request addresses an issue where the Swagger plugin for ElysiaJS was not effectively merging custom components provided at the application level.
Example of the problem:
Would result on a /swagger/json like this:
With this fix, the plugin now correctly merges the user-defined components from the documentation configuration with the default schemas from app.meta.defs. This ensures that all user-defined Swagger components are accurately reflected in the generated documentation.