-
Notifications
You must be signed in to change notification settings - Fork 84
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
Optic lint reports errors for valid examples #2160
Comments
Hey @klaude - thanks for the detailed bug report - I've got a PR open for a bug fix for the As for the title: Link
description: |
backmarket common Link model
For more info check this [link](https://github.com/BackMarket/RFC/blob/master/api/models/API-Model-Link.md)(internal)
type: object # <- here's the line
oneOf:
- $ref: ./LinkInternal.yaml
- $ref: ./LinkExternal.yaml
x-internal: false My suggestion for the link/0 error is to update your schema to remove the I'll report back here once the above PR is merged in and I've published a new version |
Thanks for the fast response, @niclim. You make a great point about our link schema. I'll try that out and let you know how it goes. The link schema has been a thorn in our side for a while, and I bet this would fix a lot of stuff. |
Hi @klaude I just released |
@niclim I can confirm that 0.48.2 indeed fixes the issue. Thanks for the help and fast turn around! |
Describe the bug
Howdy, Optic folks. 👋
optic lint
reports invalid examples in our services. The services are OAS compliant, and we've run them through spectral to be sure. We've noticed this in versions 0.47 and 0.48 of the CLI utility. Therequire_request_examples
,require_response_examples
, andrequire_parameter_examples
rules report these false errorsWe've triple checked our specs and tried different combinations of defining or not defining examples, but haven't found a fix. We've also tried linting bundled and de-referenced versions of our specs (using
optic bundle
andoptic dereference
) but run into the same issue. Bundled and de-referenced specifications look correct too.We noticed similar issues around OAS examples with spectral. They ended up ignoring superfluous errors from ajv to fix those issues (stoplightio/spectral#2408). I wonder if something similar is happening here too.
Thanks for your time and for looking! Please let me know if there's any other information I can provide.
To Reproduce
Steps to reproduce the behavior:
The following OpenAPI spec is a slimmed down version of one of our service APIs. It uses schemas defined in-line in the operation's response, defined in
components/schemas
, and defined by remote URL. Please let me know if you'd like our organization or API IDs to help troubleshoot.Our Optic standard's contents are:
optic lint
against the following fileExpected behavior
I expect
optic lint
to passScreenshots
I don't have screenshots, but here's console output:
My system:
Linting with spectral passes:
But linting with optic produces errors:
Details (please complete the following information):
Additional context
None, but thanks again for looking. ❤️
The text was updated successfully, but these errors were encountered: