[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
- Download https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
- Generate markdown docs from the downloaded Pet Store sample yaml i.e.
openapi-generator generate -i petstore.yaml -o petapidocs -g markdown
- 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