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

Missing "description" in subschema raises "No subschema in "anyOf" matched." #329

Open
ryanbrainard opened this issue Sep 27, 2017 · 1 comment

Comments

@ryanbrainard
Copy link

I had a property that looked like this:

  channel:
    type:
    - object
    properties:
      id:
        "$ref": "/schemata/channel#/definitions/id"
      name:
        "$ref": "/schemata/channel#/definitions/name"

which was raising the error:

schema/schema.json: #/definitions/approval/properties/channel: failed schema #/definitions/resource/properties/properties/patternProperties/^[a-z0-9][a-zA-Z0-9_]*[a-zA-Z0-9]$: No subschema in "anyOf" matched.

This error was not very helpful at explaining what the problem actually was. After much trial and error, it was the fact that the description was missing. i.e. this fixed it:

  channel:
    description: THIS IS THE FIX
    type:
    - object
    properties:
      id:
        "$ref": "/schemata/channel#/definitions/id"
      name:
        "$ref": "/schemata/channel#/definitions/name"

Can we please have a better error message for this?

prmd 0.13.0

@ryanbrainard
Copy link
Author

I should also note that this was a breaking change. I upgrade from prmd 0.7.0 to 0.13.0 and the same schema no longer validated.

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

1 participant