-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Comment for a $ref in definition fires a semantic error. #1305
Comments
Can't reproduce this. I tried this, and only got a resolver error for the non-existent path:
@Cooker-Monster, can you provide a test spec for this? |
swagger: "2.0"
info:
description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
version: "1.0.0"
title: "Swagger Petstore"
host: "petstore.swagger.io"
basePath: "/v2"
schemes:
- "http"
paths:
/:
get:
responses:
200:
$ref: '#/responses/test'
schema:
type: string
responses:
test:
description: hello |
Alright, I read this wrong 😄 Fixing. |
Fast & efficient => congrats !!! |
@matthieugeerebaert, it’s up to date 😄 that error looks valid, you can’t have any other values alongside a $ref, because $ref works by replacing itself and everything on its level with the data it is pointing at. see #1184 for more context on this. |
Oups sorry ! I read this issue too quickly, it's only about comment, thought it was a general issue that semantic "Sibling values are not allowed alongside a $ref" should only be warning. And yes #1184 is my current problem. We have hundred of swaggers with attribute description and definition description :( Having now those "Error" is a major problem, I was trying to find honorable workaround :) Sorry for my bad interpretation Shockey ;) |
Hey so using comment instead of description might be a good workaround, thank you ! |
@matthieugeerebaert no problem! I just realized that our new validation system is actually reporting this as an error again, so there was something to fix here after all 😄 |
Thank you Shockey, perfect ! |
Hi @shockey, TIA, |
hi @scara, this is fixed! |
TNX @shockey for the follow up! Everything looks OK now: a gently warning is fired in the editor while nothing appears in the viewer pane. |
New editor defines "Sibling values are not allowed alongside a $ref." as a Semantic Error as the previous one defined it as a Warning.
I think that put a comment for a $ref is not a semantic error.
Rolling back as warning could be nice (in fact, allowing comment on $ref without warning won't offend me).
The text was updated successfully, but these errors were encountered: