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

[Schema Inaccuracy] Invalid examples reported by Spectral #31

Closed
philsturgeon opened this issue Aug 21, 2020 · 3 comments
Closed

[Schema Inaccuracy] Invalid examples reported by Spectral #31

philsturgeon opened this issue Aug 21, 2020 · 3 comments
Assignees

Comments

@philsturgeon
Copy link
Contributor

philsturgeon commented Aug 21, 2020

Schema Inaccuracy

I know you lot use Spectral for some internal stuff, and I wanted to let you know we've been working on a new feature that lets you know when examples are invalid against their defined schema (stoplightio/spectral#1284). It looks like there's quite a few invalid examples in this repo, so I figured I should give you a heads up to resolve them before you upgrade and have to fix things in a rush.

Expected

I'd expect none of these errors to be here. (Some are showing up twice and we're investigating why, and some of the errors are a little hard to read and we're working on that too).

Screen Shot 2020-08-21 at 5 10 31 PM

It's because the enum is only showing uploaded, and then the example is open.

        state:
          description: State of the release asset.
          type: string
          enum:
          - uploaded
          example: open

I'd ditch that example and put it in the enum. Most tooling will take an enum value and use it as an example if a property doesn't have one (especially ReDoc, which you mentioned in the README.md).

        state:
          description: State of the release asset.
          type: string
          enum:
          - uploaded
          - open

Simple enough fix right?

Reproduction Steps

Clone spectral.

$ gco fix/support-examples-validation
$ yarn
$ yarn build
$ yarn cli lint {path-to-this-repo}/descriptions/api.github.com/api.github.com.yaml
@xuorig
Copy link

xuorig commented Aug 21, 2020

Thanks @philsturgeon, taking a look 👀

@xuorig xuorig self-assigned this Aug 21, 2020
@philsturgeon
Copy link
Contributor Author

Still seeing a lot of these.

image

@xuorig xuorig removed their assignment Dec 18, 2020
@ahoglund ahoglund self-assigned this Dec 18, 2020
@ahoglund
Copy link
Contributor

ahoglund commented Feb 5, 2021

These should all be resolved now. Please feel free to reopen if you see any more come up.

@ahoglund ahoglund closed this as completed Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants