Answer the question
In order to leave comments, you need to log in
When should you put "-" before $ref: in OpenAPI (Swagger)?
I don't grasp the system, in which cases it is necessary to write like this:
- $ref: '#/components/schemas/User'
and when like this:
$ref: '#/components/schemas/User'
Clarify the question plz, who knows :)
What does this hyphen mean in OpenAPI?
Answer the question
In order to leave comments, you need to log in
Read about YAML syntax.
A hyphen at the beginning of a line means "array element"
. the first entry is the
second just
[ { "$ref": "#/components/schemas/User" } ]
{ "$ref": "#/components/schemas/User" }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question