-
Notifications
You must be signed in to change notification settings - Fork 132
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
Reported Error location does not point at correct node for Parameters #1241
Comments
Thanks for raising this, but the current behaviour makes sense to me. The problem that the linter describes is that there's a mismatch with the parameter name or where it should be found (path, header, etc). The parameter object itself is therefore the location of the problem, it's a Reporting in the location that makes the error apparent is also consistent with how the other types of error are reported. I'm open to more discussion on this, but for the specific scenario given here, I am not in favour of making changes. |
We used to show "referenced from" for every error if it's referenced. This was gone after some major refactoring but I believe we can bring it back. I think this would be a great middle-ground. |
@lornajane I'm not sure I agree with your comment
The problem lies in the location where a reusable component has been referenced, the problem itself is not the parameter definition, but the location of its use. @RomanHotsiy sounds reasonable. |
some additional context on why I raised this, using the VS Code extension in the design phase, in the The behavior on the cli may be acceptable with the context provided because you can't interact with the output in the same way as the vsc extension. This is may be considered a separate use case. |
Thank you @jeremyfiel! In such case this is not a bug, but rather enhancement.
For me @RomanHotsiy suggestion sounds reasonable. We can use proposed solution in this case. |
Describe the bug
When an error is produced for a required parameter in the uri, the error location points at the component schema rather than the actual error location in the
parameters
collection, this makes it difficult to trace which line has the actual error. In this example, the$ref
on line 89 should be indicated.To Reproduce
Steps to reproduce the behavior:
redocly.yaml
fileRun this command with these arguments...
redocly lint --config redocly.yaml fcc-classroom-userdata-openapi.json
See error
Expected behavior
The error location line number shall be the correct node where the error occurs, not the referenced location
Redocly Version(s)
redocly --version
1.0.2
Node.js
Version(s)node v14.18.1 (npm v6.14.15)
The text was updated successfully, but these errors were encountered: