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

Regression in oas3-examples-value-or-externalValue: examples in examples is asked to be OpenAPI compliant #1406

Closed
m-mohr opened this issue Nov 20, 2020 · 2 comments · Fixed by #1428
Assignees
Labels
t/bug Something isn't working
Milestone

Comments

@m-mohr
Copy link
Contributor

m-mohr commented Nov 20, 2020

Describe the bug

Examples properties in OpenAPI Examples are reported as invalid although they are the actual examples and contain no value or external value, of course. This seems to be a regression (or just something related) of my fix in #899.

To Reproduce

Validate https://raw.githubusercontent.com/Open-EO/openeo-api/draft/openapi.yaml

Response (reports for oas3-unused-components-schema may be valid, reports for oas3-examples-value-or-externalValue are likely invalid):

> spectral lint openapi.yaml

OpenAPI 3.x detected

c:/dev/openeo-api/openapi.yaml
 1592:25  warning  oas3-examples-value-or-externalValue  Examples should have either a `value` or `externalValue` field.
 1596:25  warning  oas3-examples-value-or-externalValue  Examples should have either a `value` or `externalValue` field.
 1600:25  warning  oas3-examples-value-or-externalValue  Examples should have either a `value` or `externalValue` field.
 3330:30  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 3398:16  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 4264:21  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 4281:21  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 4347:34  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 4353:32  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 4364:24  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 4680:17  warning  oas3-examples-value-or-externalValue  Examples should have either a `value` or `externalValue` field.
 4734:11  warning  oas3-examples-value-or-externalValue  Examples should have either a `value` or `externalValue` field.
 5414:18  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 5453:23  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 5465:20  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 5479:23  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 5491:28  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 5505:25  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.
 5521:31  warning  oas3-unused-components-schema         Potentially unused components schema has been detected.

✖ 19 problems (0 errors, 19 warnings, 0 infos, 0 hints)

Expected behavior

No warnings for rule oas3-examples-value-or-externalValue.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (remove any that are not applicable):

  • Library version: 5.7.1
  • OS: Win10
@m-mohr m-mohr added the t/bug Something isn't working label Nov 20, 2020
@P0lip P0lip self-assigned this Dec 29, 2020
@P0lip
Copy link
Contributor

P0lip commented Dec 29, 2020

Hey!
My sincere apologies for dropping a ball on this one.
It turned out the issue was caused by JSON path expression used by that rule.
The expression was tad too broad and matched too many spots in the document.
I tweaked it - the PR is over here #1428.
Feel free to take a look at it if you wish.

@m-mohr
Copy link
Contributor Author

m-mohr commented Jan 6, 2021

Works for me, thanks.

@P0lip P0lip added this to the 2020-12-15 milestone Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants