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
  • #5449
Closed
Open
Issue created Feb 26, 2020 by Administrator@rootContributor

[BUG][MARKDOWN] Primitive Type not set to true for primitives on Models

Created by: HieronymusLex

Description

When using both the html and markdown doc generators, isPrimitiveType is set to false for model vars even if the var is a primitive type. This leads to dead links for primitive types e.g. https://github.com/OpenAPITools/openapi-generator/blob/master/samples/documentation/markdown/Models/ApiResponse.md

openapi-generator version

v4.2.3

Command line used for generation
openapi-generator generate -i ./definition.yaml -g markdown -o docs
Steps to reproduce
  1. Download https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
  2. Generate markdown docs from the downloaded Pet Store sample yaml i.e.
    openapi-generator generate -i petstore.yaml -o petapidocs -g markdown
  3. View petapidocs/Models/Pet.md

Expected Result Primitive types such as string, integer etc. should not link to an external file. The relevant part of the mustache template: {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}} https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/markdown-documentation/model.mustache#L10

Actual Result Primitive types all have dead links because isPrimitiveType is set to false in the template

Suggest a fix

My guess is that there is something wrong with how isPrimitiveType is set for model vars but unsure what the fix is yet. I'll keep looking

Assignee
Assign to
Time tracking