File tree Expand file tree Collapse file tree
openapi-processor-core/src
main/kotlin/io/openapiprocessor/core/writer/java
testInt/resources/tests/javadoc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,8 +95,11 @@ abstract class DataTypeWriterBase(
9595 var result = ""
9696
9797 if (apiOptions.javadoc && !apiOptions.isRecord()) {
98- result += javadocFactory.create(propDataType).indent()
99- result += LF
98+ val javadoc = javadocFactory.create(propDataType)
99+ if (javadoc.isNotEmpty()) {
100+ result += javadoc.indent()
101+ result += LF
102+ }
100103 }
101104
102105 result += ifDeprecated(propDataType)
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ components:
5656 this is the *Foo* schema description
5757 type: object
5858 properties:
59+ no-description:
60+ type: string
5961 foo-bar:
6062 description: >
6163 *property* description
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ components:
5656 this is the *Foo* schema description
5757 type: object
5858 properties:
59+ no-description:
60+ type: string
5961 foo-bar:
6062 description: >
6163 *property* description
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ components:
5252 this is the *Foo* schema description
5353 type: object
5454 properties:
55+ no-description:
56+ type: string
5557 foo-bar:
5658 description: |
5759 *property* description
Original file line number Diff line number Diff line change 99@Generated(value = "openapi-processor-core", version = "test")
1010public class Foo {
1111
12+ @JsonProperty("no-description")
13+ private String noDescription;
14+
1215 /**
1316 * <em>property</em> description
1417 */
@@ -21,6 +24,14 @@ public class Foo {
2124 @JsonProperty("enum")
2225 private FooEnum aEnum;
2326
27+ public String getNoDescription() {
28+ return noDescription;
29+ }
30+
31+ public void setNoDescription(String noDescription) {
32+ this.noDescription = noDescription;
33+ }
34+
2435 public String getFooBar() {
2536 return fooBar;
2637 }
Original file line number Diff line number Diff line change 1111 */
1212@Generated(value = "openapi-processor-core", version = "test")
1313public record Foo(
14+ @JsonProperty("no-description")
15+ String noDescription,
16+
1417 @JsonProperty("foo-bar")
1518 String fooBar,
1619
You can’t perform that action at this time.
0 commit comments