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

null generates Value #70

Open
lizelive opened this issue Apr 11, 2023 · 0 comments
Open

null generates Value #70

lizelive opened this issue Apr 11, 2023 · 0 comments

Comments

@lizelive
Copy link

lizelive commented Apr 11, 2023

for the schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Hashable Value",
    "id": "https://schema.qhpea.org/hashable-value.json",
    "oneOf": [
        {
            "title": "Null",
            "type": "null"
        },
        {
            "title": "Boolean",
            "type": "boolean"
        },
        {
            "title": "Integer",
            "type": "integer"
        },
        {
            "title": "String",
            "type": "string"
        },
        {
            "title": "Array",
            "type": "array",
            "items": {
                "$ref": "#"
            }
        },
        {
            "title": "Object",
            "type": "object",
            "additionalProperties": {
                "$ref": "#"
            }
        }
    ]
}

it generates

pub type HashableValueNull = Value;

pub enum HashableValue {
    Null(HashableValueNull),
    Boolean(HashableValueBoolean),
    Integer(HashableValueInteger),
    String(HashableValueString),
    Array(HashableValueArray),
    Object(HashableValueObject),
}

this is silly

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