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

Good code is red: "Missing required property '$ref' #297

Open
jgindin opened this issue Dec 3, 2019 · 0 comments
Open

Good code is red: "Missing required property '$ref' #297

jgindin opened this issue Dec 3, 2019 · 0 comments

Comments

@jgindin
Copy link

jgindin commented Dec 3, 2019

I just installed the OpenAPI editor to give it a try. I've been using Apicurio to generate my YAML. The first time opening one of my YAML files in IntelliJ, I see a bunch of red.

This is the first big red block. I'm really not sure why it thinks I'm missing a '$ref' property:
image

There's another block that has the same problem.

It seems that the actual problem is the use of a "description" when the property is defined by a $ref.

I verified this by deleting the "description" associated with each of the properties that is defined by a $ref.

Interestingly, if a data type has 1 or 2 properties with this "extraneous" "description", then only the $ref and description are colored red. Although, in this case, the error message is wrong:

Property '$ref' is not allowed
image

It seems that these "description"s ought to be no more than a possible warning. At least according to https://swagger.io/docs/specification/using-ref/ (see the "$ref and Sibling Elements" section):

Any sibling elements of a $ref are ignored.

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

No branches or pull requests

1 participant