Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
HieronymusLex opened this issue Feb 26, 2020 · 1 comment · Fixed by #10106
Closed

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

HieronymusLex opened this issue Feb 26, 2020 · 1 comment · Fixed by #10106

Comments

@HieronymusLex
Copy link

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

@HieronymusLex HieronymusLex changed the title [BUG][MARKDOWN] Primitive Type not set to true for Models [BUG][MARKDOWN] Primitive Type not set to true for primitives on Models Feb 26, 2020
@joelstobart
Copy link

It would be good to have this resolved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants