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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I use openapi generator with spring boot. I have specification of api and i want use 3.1.1 Openapi version. I have a model with arrays and want to provide example.
when I set into spec 3.1.1 version i have a such code in generated files (incorrect):
@Schema(name = "nodes", example = "[{name=Node1}, {name=Node2}, {name=Node3}]", description = "List of nodes in the EventGraph.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
when i set 3.0.1 version in spec file i have this (correct):
@Schema(name = "nodes", example = "[{\"name\":\"Node1\"},{\"name\":\"Node2\"},{\"name\":\"Node3\"}]", description = "List of nodes in the EventGraph.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
openapi-generator version
gradle plugin id "org.openapi.generator" version "7.12.0"
generator: spring
OpenAPI declaration file content or url
openapi: 3.1.1info:
title: EventGraph APIversion: 1.0.0paths:
/simplePost:
post:
summary: Simple post requestdescription: descriptionrequestBody:
required: truecontent:
application/json:
schema:
$ref: '#/components/schemas/SomeDTO'responses:
'200':
description: Expected response to a valid requestcontent:
application/json:
schema:
$ref: "#/components/schemas/SomeDTO"components:
schemas:
SomeDTO:
type: objectproperties:
name:
type: stringnodes:
description: List of nodes in the EventGraph.type: arrayitems:
$ref: '#/components/schemas/NodeDTO'example:
- name: Node1
- name: Node2
- name: Node3NodeDTO:
type: objectproperties:
name:
type: stringrequired:
- name
Bug Report Checklist
Description
I use openapi generator with spring boot. I have specification of api and i want use 3.1.1 Openapi version. I have a model with arrays and want to provide example.
when I set into spec 3.1.1 version i have a such code in generated files (incorrect):
when i set 3.0.1 version in spec file i have this (correct):
openapi-generator version
gradle plugin id "org.openapi.generator" version "7.12.0"
generator: spring
OpenAPI declaration file content or url
Generation Details
generator - spring
Steps to reproduce
Use my specification(i thing any spec with array example). Use gradle plugin with specification in the issue
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: