docusaurus-openapi-docs
docusaurus-openapi-docs copied to clipboard
Using $ref for primitive types erases the field type
Documentation link
https://docs.nabla.com
Describe the problem
When declaring a field like the following:
email:
$ref: "./shared/user_email.yaml"
While user_email.yaml is:
type: string
description: Some long description for what a user email is used for etc etc etc... The same "email" field is reused in multiple endpoints (to share the description).
The output is:
While I expect it to be (same as if the $ref was inlined):
Suggested fix
Instead of: always assuming a $ref is referencing a complex object and thus giving its type a "name" (picking the file name is ok) while the rest of the doc-gen will indent the nested fields and everything is well-documented. I suggest the doc-gen code to first checks if the referenced type is a primitive (string, boolean, or number) and if so lets its type name be the primitive type itself.
I think this should be labeled as a bug. I'm having the same issue, any references to strings display the referenced name as the format instead of string as the format.
@AchrafAmil are you able to change the label of your issue from "documentation" to "bug"?
I agree but I can't change labels
upgraded to 2.1.3 and this is fixed: it shows file name (primitive type) (e.g. user_email (string)).