fix multi line description in allOf (#17879)

This commit is contained in:
William Cheng
2024-02-16 15:26:15 +08:00
committed by GitHub
parent 5a0f6b8eb2
commit 436a3e0744
5 changed files with 13 additions and 4 deletions

View File

@@ -4214,7 +4214,8 @@ public class DefaultCodegen implements CodegenConfig {
property.deprecated = p.getDeprecated(); property.deprecated = p.getDeprecated();
} }
if (original.getDescription() != null) { if (original.getDescription() != null) {
property.description = p.getDescription(); property.description = escapeText(p.getDescription());
property.unescapedDescription = p.getDescription();
} }
if (original.getMaxLength() != null) { if (original.getMaxLength() != null) {
property.setMaxLength(original.getMaxLength()); property.setMaxLength(original.getMaxLength());

View File

@@ -2577,6 +2577,10 @@ components:
format: int64 format: int64
x-is-unique: true x-is-unique: true
category: category:
description: |
multi line description
2nd line
last line
allOf: allOf:
- $ref: '#/components/schemas/Category' - $ref: '#/components/schemas/Category'
name: name:

View File

@@ -2560,6 +2560,10 @@ components:
category: category:
allOf: allOf:
- $ref: '#/components/schemas/Category' - $ref: '#/components/schemas/Category'
description: |
multi line description
2nd line
last line
name: name:
example: doggie example: doggie
type: string type: string

View File

@@ -8,7 +8,7 @@
| Name | Type | Description | Notes | | Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------| |------------ | ------------- | ------------- | -------------|
|**id** | **Long** | | [optional] | |**id** | **Long** | | [optional] |
|**category** | [**Category**](Category.md) | | [optional] | |**category** | [**Category**](Category.md) | multi line description 2nd line last line | [optional] |
|**name** | **String** | | | |**name** | **String** | | |
|**photoUrls** | **List<String>** | | | |**photoUrls** | **List<String>** | | |
|**tags** | [**List<Tag>**](Tag.md) | | [optional] | |**tags** | [**List<Tag>**](Tag.md) | | [optional] |

View File

@@ -161,7 +161,7 @@ public class PetUsingAllOf {
} }
/** /**
* Get category * multi line description 2nd line last line
* @return category * @return category
**/ **/
@javax.annotation.Nullable @javax.annotation.Nullable