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

Parameters in links objects shouldn't be linted for not having a description property. #272

Closed
garethj-msft opened this issue Jun 26, 2019 · 2 comments · Fixed by #515
Closed
Assignees
Labels
enhancement New feature or request t/bug Something isn't working

Comments

@garethj-msft
Copy link

I'm submitting a...

  • [ x ] bug report

What is the current behavior?

Lint an OAS 3 with links section, where a link object has a parameters collection containing the usual name to path dictionary.
Get warnings like this:

Rule:
Parameter objects should have a description.

Details:
paths./allSchools/createUploadSession.post.responses.201.links.getUploadSessionById.parameters.sessionId.description is not truthy

But the parameters collection in a links object is not a parameters object.

What is the expected behavior?

No warning.

What is the motivation / use case for changing the behavior?

Correctness.

Please tell us about your environment:

Web version.

@philsturgeon
Copy link
Contributor

Ok this sounds like the rule for parameters is just a little greedy. The trouble with making them too specific is that then we have trouble linting on partial files with $ref, as if we just see the word parameters we dont know if its links parameters or operation parameters. 🤔

@philsturgeon philsturgeon added this to the September '19 Hardening milestone Aug 14, 2019
@philsturgeon philsturgeon added the enhancement New feature or request label Aug 14, 2019
@marbemac marbemac modified the milestones: August '19 Hardening, Aug '19 Hardening Aug 20, 2019
@marbemac
Copy link
Contributor

Hmm, right now we look for parameters objects that don't have a $ref key. While still not perfect, a better indicator might be check for presence of an in key. This would cover $ref and also fix the issue described here re link parameters property false identification.

Relevant rule: https://github.com/stoplightio/spectral/blob/develop/src/rulesets/oas/index.json#L344

@philsturgeon philsturgeon added the t/bug Something isn't working label Aug 27, 2019
@marbemac marbemac removed this from the Aug '19 Hardening milestone Aug 27, 2019
@lag-of-death lag-of-death self-assigned this Aug 30, 2019
@lag-of-death lag-of-death added this to the Aug '19 Hardening milestone Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants