openapi生成器maven插件生成带格式的AsciiDoc描述



我正在使用openapi生成器maven插件5.4.0版本将我的openapi.json文件转换为AsciiDoc。在我的OpenApi.json规范中,我为路径参数描述设置了一些格式:

"描述":"TestDescriptionLine2 TestDescription";,

但AsciiDoc生成器输出它时没有格式化:

测试描述第2行测试描述

有办法保留我的格式吗?

我如何使用插件:

<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.4.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>openapi.json</inputSpec>
<generatorName>asciidoc</generatorName>
<skipValidateSpec>true</skipValidateSpec>
<configOptions>
<useIntroduction>true</useIntroduction>
<useMethodAndPath>true</useMethodAndPath>
<useTableTitles>true</useTableTitles>
</configOptions>
<output>output</output>
</configuration>
</execution>
</executions>
</plugin>

我的openapi.json文件:

{
"openapi": "3.0.1",
"info": {
"title": "TestOpenAPI",
"description": "Testdescription",
"version": "1.2.3"
},
"servers": [
{
"url": "http://TestServer"
}
],
"tags": [
{
"name": "testTag",
"description": "TestDescription"
}
],
"paths": {
"/texts": {
"get": {
"tags": [
"TestTag1"
],
"operationId": "testOperation",
"parameters": [
{
"name": "testName",
"in": "query",
"description": "TestDescription n Line2 TestDescription",
"required": true,
"schema": {
"pattern": "^(([a-z]{2}_[A-Z]{2})+,){0,9}([a-z]{2}_[A-Z]{2}){1}$",
"type": "string",
"description": "TestDescription n Line2 TestDescription"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/test"
},
{
"$ref": "#/components/schemas/test2"
}
]
}
}
}
}
}
}
},
"components": {
"schemas": {
"test": {
"type": "object",
"properties": {
"texts": {
"type": "array",
"xml": {
"name": "text"
},
"items": {
"$ref": "#/components/schemas/test"
}
}
},
"xml": {
"name": "texts"
}
},
"TextType": {
"required": [],
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "The key of the text"
},
"value": {
"type": "string",
"description": "The value of the text"
},
"category": {
"type": "string",
"description": "The category of the text"
},
"language": {
"maxLength": 5,
"minLength": 5,
"pattern": "[a-z]{2}_[A-Z]{2}",
"type": "string",
"description": "TestDescription n Line2 TestDescription"
}
}
}
}
}
}
}

OpenApi支持MarkDown语法来呈现富文本。例如:

description: |
# Title with *italics*
Next line
Some **bold** comments

(点击此处查看更多(

现在的问题是:OpenapiTools插件在遇到这样的加价时会如何表现。。。

相关内容

  • 没有找到相关文章

最新更新