[BUG] Confluence Wiki output doesn't work for array types
Created by: zyrain
Bug Report Checklist
- [Y] Have you provided a full/minimal spec to reproduce the issue?
- [Y] Have you validated the input using an OpenAPI validator (example)?
- [Y] Have you tested with the latest master to confirm the issue still exists?
- [Y] Have you searched for related issues/PRs?
- [Y] What's the actual output vs expected output?
- [N] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When the openAPI spec contains array types, the generator doesn't create proper Cwiki.
Example (incorrect) output: ... || Response Type | array[ErrorResult] | || Response Model | [array[ErrorResult] Model|#array[ErrorResult]ModelAnchor|Jump to model] |
It should be more like: ... || Response Type | array of ErrorResult | || Response Model | [ErrorResult Model|#ErrorResultModelAnchor|Jump to model] |
openapi-generator version
v4.3.1
OpenAPI declaration file content or url
{
"openapi": "3.0.1",
"info": { "title": "foo", "version": "1.0.0" },
"servers": [ { "url": "https://foo.com/bar" } ],
"paths": {
"/foo": {
"get": {
"summary": "baz",
"operationId": "getBaz",
"responses": { "404": { "description": "Requested resource was not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArrayOfErrorResult" } } } } }
}
}
},
"components": { "schemas": {
"ErrorResult": { "type": "object", "properties": { "message": {
"type": "string",
"description": "Additional details about error encountered"
},
"code": { "type": "integer", "description": "Error code", "format": "int32" } },
"description": "Contains error details of request"
},
"ArrayOfErrorResult": { "type": "array", "items": { "$ref": "#/components/schemas/ErrorResult" } } } } }
Generation Details
openapi-generator generate -i example.json -g cwiki
Related issues/PRs
Didn't see any
Suggest a fix
The mustache file looks correct, but it's using a field ({{{dataType}}} that puts in the square brackets, confusing Confluence. Simple escaping doesn't seem to work.