We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Schema
description
Describe the bug
To Reproduce Steps to reproduce the behavior:
2.6.4
org.springdoc:springdoc-openapi-ui:1.6.6
What I want is the following display.
{ "openapi": "3.0.1", "info": { "title": "OpenAPI definition", "version": "v0" }, "servers": [{ "url": "http://localhost:8080", "description": "Generated server url" }], "paths": { "/test": { "patch": { "tags": ["test-controller"], "operationId": "test", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestBO" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "string" } } } } } } } }, "components": { "schemas": { "TestBO": { "type": "object", "properties": { "id": { "type": "integer", "description": "the id", "format": "int32" }, "testFiled": { "type": "integer", "description": "test filed with something", "format": "int32" }, "pcount": { "type": "integer", "description": "something with p", "format": "int32" }, "ccount": { "type": "integer", "description": "something with c", "format": "int32" } }, "description": "TestBO" } } } }
Actually, the descriptions of pcount and ccount are not in the OpenAPI Doc, I have provided an example project below to demonstrate the problem.
descriptions
pcount
ccount
{ "openapi": "3.0.1", "info": { "title": "OpenAPI definition", "version": "v0" }, "servers": [{ "url": "http://localhost:8080", "description": "Generated server url" }], "paths": { "/test": { "patch": { "tags": ["test-controller"], "operationId": "test", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestBO" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "string" } } } } } } } }, "components": { "schemas": { "TestBO": { "type": "object", "properties": { "id": { "type": "integer", "description": "the id", "format": "int32" }, "testFiled": { "type": "integer", "description": "test filed with something", "format": "int32" }, "pcount": { "type": "integer", "format": "int32" }, "ccount": { "type": "integer", "format": "int32" } }, "description": "TestBO" } } } }
An example git repository is at https://github.com/linghengqian/springdoc-schema-test .
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
No.
The text was updated successfully, but these errors were encountered:
@linghengqian,
This is related to this lombok issue: projectlombok/lombok#2693 If you use, standard java getter/setter it will just work out of the box.
import java.io.Serializable; import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication public class SpringdocSchemaTestApplication { public static void main(String[] args) { SpringApplication.run(SpringdocSchemaTestApplication.class, args); } } @RestController class testController { @PatchMapping("/test") public String test(@RequestBody TestBO testBO) { return "test" + testBO.getpCount() + testBO.getcCount(); } } @Schema(description = "TestBO") class TestBO implements Serializable { private static final long serialVersionUID = 1L; @Schema(description = "the id") private Integer id; @Schema(description = "something with c") private Integer cCount; @Schema(description = "something with p") private Integer pCount; @Schema(description = "test filed with something") private Integer testFiled; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getcCount() { return cCount; } public void setcCount(Integer cCount) { this.cCount = cCount; } public Integer getpCount() { return pCount; } public void setpCount(Integer pCount) { this.pCount = pCount; } public Integer getTestFiled() { return testFiled; } public void setTestFiled(Integer testFiled) { this.testFiled = testFiled; } }
Sorry, something went wrong.
No branches or pull requests
Describe the bug
To Reproduce
Steps to reproduce the behavior:
2.6.4
org.springdoc:springdoc-openapi-ui:1.6.6
What I want is the following display.
Actually, the
descriptions
ofpcount
andccount
are not in the OpenAPI Doc, I have provided an example project below to demonstrate the problem.An example git repository is at https://github.com/linghengqian/springdoc-schema-test .
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
No.
The text was updated successfully, but these errors were encountered: