Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7485
Closed
Open
Issue created Sep 22, 2020 by Administrator@rootContributor

[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.

Assignee
Assign to
Time tracking