I’m using spring-boot 3.2
here is my dependencies:
pom.xml
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</version>
</dependency>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.6.0</version>
...
so I want to display examples under one schema. Here is my test endpoint:
openapi.yaml
paths:
/tests:
get:
summary: 'test'
description: 'test'
operationId: getTestData
responses:
'200':
description: 'test'
content:
application/json:
schema:
type: string
examples:
test-example:
value: 'test-data'
and in swagger I got:
enter image description here
and also v3/api-docs also dont contain examples
enter image description here
example instead of examples also not working. examples for the parameters and requests also not working.
but example on the schema level is working:
schemas:
Email:
type: string
format: email
description: 'User''s email'
pattern: '^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+.[A-Za-z]{1,}$'
example: '[email protected]'