Skip to content

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

Description

@ryanbrainard

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions