Describe the bug
While descriptions from JavaDoc normally work, if you rename json property, it looses JavaDoc description.
I presume somewhere inside it does not keep original property name and if the name gets change by JsonProperty it loses mapping with JavaDoc.
To Reproduce
Steps to reproduce the behavior:
Create Webflux API server.
Add controller with POST request using model class with a property.
Enable JavaDoc, generate Swagger - JavaDoc is used as description.
Add JsonProperty with different name over the property - description becomes empty.
- What version of spring-boot you are using?
3.1.1
- What modules and versions of springdoc-openapi are you using?
- springdoc-openapi-starter-webflux-ui: 2.1.0
- therapi-runtime-javadoc: 0.15.0
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>com.github.therapi</groupId>
<artifactId>therapi-runtime-javadoc-scribe</artifactId>
<version>0.15.0</version>
</path>
- What is the actual and the expected result using OpenAPI Description (yml or json)?
Property description taken from JavaDoc becomes empty if JsonProperty is used.
"properties": {
"task_id": {
"type": "string"
}
}
Expected property description from JavaDoc regardless of using JsonProperty attribute.
"properties": {
"task_id": {
"type": "string",
"description": "Test model property."
}
}
- Provide with a sample code (HelloController) or Test that reproduces the problem
/**
* Test model.
*/
@Data
@Builder
public class TestModel {
/**
* Test model property.
*/
@JsonProperty("test_property")
String property;
}
public class TestController {
@PostMapping("test-request")
public Mono<Void> testRequest(
@RequestBody TestModel model) {
return null;
}
Expected behavior
The property should change its name with JsonProperty but description should stay as per JavaDoc.
Describe the bug
While descriptions from JavaDoc normally work, if you rename json property, it looses JavaDoc description.
I presume somewhere inside it does not keep original property name and if the name gets change by JsonProperty it loses mapping with JavaDoc.
To Reproduce
Steps to reproduce the behavior:
Create Webflux API server.
Add controller with POST request using model class with a property.
Enable JavaDoc, generate Swagger - JavaDoc is used as
description.Add
JsonPropertywith different name over the property -descriptionbecomes empty.3.1.1
Property description taken from JavaDoc becomes empty if JsonProperty is used.
Expected property description from JavaDoc regardless of using JsonProperty attribute.
Expected behavior
The property should change its name with JsonProperty but description should stay as per JavaDoc.