Open T-Developer1 opened 2 years ago
My OpenAPI Json Looks like this:
{
"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"
}
}
}
}
}
}
}
But The Ascii Output is always written in one line
[cols="2,3,1,1,1"] .Query Parameters |=== |Name| Description| Required| Default| Pattern
| testName | TestDescription Line2 TestDescription | X | null | /^(([a-z]{2}[A-Z]{2})+,){0,9}([a-z]{2}[A-Z]{2}){1}$/
|===
Hi, i am using the openapi-generator-maven-plugin to generate Ascii from a json file. My Json File has some special Formatations like \n for new lines in the descirption, but the Plugin deletes the Formatation.
I found a Function in the openapi-generator and i think thats the reason why my Formatation is deleted.
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
I am using the Plugin like this:
Is there a way to use the plugin with my Formatation?
Describe the solution you'd like
A Possibility to insert Formatations to the Descriptions