Skip to content

class bar: "ok" | "fail" | "abort" | string; should not only map to a string #164

Open
@gdimauro

Description

@gdimauro

Hi to everyone, test "string-literals-inline" field bar:

class MyObject {
    ...
    bar: "ok" | "fail" | "abort" | string;
}

maps to schema:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "properties": {
        "bar": {
            "type": "string"
        }, ...

but should map to schema:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "properties": {
        "bar": {
            "anyOf": [{
                    "custom": "string"
                },
                {
                    "enum": [
                        "ok",
                        "fail",
                        "abort"
                    ],
                    "default": "string"
                }
            ]
        },...

Cheers,
Giuseppe

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions