Skip to content

Cannot generate schema from reference hyperschema #290

Closed

Description

@jasminemoore-verses

Running cargo-typify 0.0.12.

Input at: https://gist.github.com/jasminemoore-verses/efc6db1f73d23adbb3a8d94a0bcd4cf2 (input.json)
Errors at: https://gist.github.com/jasminemoore-verses/efc6db1f73d23adbb3a8d94a0bcd4cf2 (output.txt)

The input document is a modified version of "draft-07-schema.json", the JSON Schema Metaschema from 2017. Self-references cannot be handled (see #289). The problems here are less clear.

Activity

  1. ahl commented on May 10, 2023

    @ahl
    Collaborator

    The initial error is that we don't currently handle the general case of type arrays:

      "type": ["object", "boolean"],

    I see other looming problems such as "if": {"$ref": "#"}, i.e. a ref to nothing? and "$ref": "#/definitions/schemaArray" which doesn't appear to be defined in this schema.

  2. jasminemoore-verses commented on May 10, 2023

    @jasminemoore-verses
    Author

    According to https://json-schema.org/understanding-json-schema/structuring.html#recursion , "#" as a "$ref" target should refer to the schema currently being parsed. ("#/definitions/schemaArray" was removed as it refers to "#", which could not be resolved (see #289 ), but is absolutely an error in this schema as presented.)

  3. ahl commented on May 27, 2023

    @ahl
    Collaborator

    See the resolution of #289

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