-
-
Notifications
You must be signed in to change notification settings - Fork 534
Closed
Description
Describe the bug
- I have a valid open-api schema for my rest-api
- I noticed that for request bodies the swagger ui shows only a json example but no schema
- I extracted the open-api json from /v3/api-docs and used it in https://editor.swagger.io/ and there I can see the schemas, please se the following screenshots
To Reproduce
Steps to reproduce the behavior:
- What version of spring-boot you are using? 3.5.3
- What modules and versions of springdoc-openapi are you using? 2.8.9
- What is the actual and the expected result using OpenAPI Description (yml or json)? json
- See the attached open-api-history.json
Here is the part of the definition which shows that the particular schema for the body is references:
"/api/v1/history/search" : {
"post" : {
"operationId" : "getHistorySearch",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/GetConfigurationHistorySearchPayload"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ConfigurationHistoryResult"
}
}
},
"description" : "OK"
}
},
"security" : [ {
"basicScheme" : [ ]
} ],
"summary" : "Try to get a single configuration-history entry for given search parameters. If a result was returned it contains a configurationId to request the real configuration, see /history/{configurationId}/configuration. The service will return the latest created (createdOn) configuration by default.",
"tags" : [ "service", "read" ]
}
},
Here is the part from my application.yml:
springdoc:
cache:
disabled: true
enable-spring-security: true
remove-broken-reference-definitions: false
show-actuator: false
show-login-endpoint: true
swagger-ui:
csrf:
enabled: true
deep-linking: true
display-request-duration: true
disable-swagger-default-url: true
filter: service
operations-sorter: method
path: /swagger-ui.html
show-common-extensions: true
show-extensions: true
syntax-highlight:
activated: true
tags-sorter: alpha
try-it-out-enabled: true
writer-with-default-pretty-printer: true
writer-with-order-by-keys: true
api-docs:
enabled: true
version: openapi-3-1
resolve-schema-properties: true
Expected behavior
- The "Schema" tab is shown next to the "Example value" tab
Screenshots
Working example via https://editor.swagger.io/

Not working example from my local running springboot service

Metadata
Metadata
Assignees
Labels
No labels