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

Required schema properties possibly not matching spec #82

Closed
franklin-ross opened this issue Jun 10, 2020 · 2 comments
Closed

Required schema properties possibly not matching spec #82

franklin-ross opened this issue Jun 10, 2020 · 2 comments

Comments

@franklin-ross
Copy link

Howdy! I'm getting some errors when I try to load our contracts up with openapi-enforcer, and I'm a bit confused, because we can load them successfully into various other validators and tools. The error I'm getting (for hundreds of routes) looks something like this:

EnforcerException: One or more errors exist in the OpenApi definition
    at: paths
      at: /things > get > responses > 200 > content > application/json
        at: schema > items
          Properties not allowed: properties, required
          Missing required property: type

It looks like it's expecting a different object at that point, or possibly just that is being overly strict on it's requirements? I'm not sure whether this is related, but it looks like type, at least, should not be required.

Is there wriggle room in the spec for our contracts to be valid for some validators and not others? Or does that look like a bug in our contracts?

Thanks for the help!

@Gi60s
Copy link
Owner

Gi60s commented Jun 10, 2020

Hey Franklin. Thanks for the question. Can you share with me either the entire Open API document or at least the portion that is failing. By looking at that I'll have a better idea of what is going on.

It may have to do with the type property not being present. Have you tried adding type: object for that items schema?

@Gi60s
Copy link
Owner

Gi60s commented Jul 24, 2020

I'm going to close this due to inactivity. Let me know if I can help in the future.

@Gi60s Gi60s closed this as completed Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants