atmosphere explorer pds.ls

Union not accepted as type #10

Closed pds.ls
Closed opened by pds.ls

The following lexicon is not accepted as valid

{
    "lexicon": 1,
    "id": "org.example.test",
    "defs": {
        "main": {
            "type": "record",
            "key":"tid",
            "record": {
                "type": "object",                
                "properties": {
                    "test":{
                        "type":"ref",
                        "ref":"#generic"
                    }
                }
            }
        },
        "generic": {
            "type": "union",
            "refs": [
                "#concrete1",
                "#concrete2"
            ],
            "closed":true
        },
        "concrete1": {
            "type": "object",
            "required":["p1"],
            "properties": {
                "p1": {
                    "type": "string"
                }
            }
        },
        "concrete2": {
            "type": "object",
            "properties": {
                "p1": {
                    "type": "string"
                }
            }
        }
    }
}

In the console i get the following message

invalid_literal at .defs.generic.type (expected "record", "query", "procedure", "subscription", "object", "array", "token", "bytes", "cid-link", "blob", "boolean", "integer", "string" or "unknown")

If i validate a record using this with goat it correctly validates

This comment was deleted.

Is this not only the case for main ( a primary type)?

Sign up or Sign in to add to the discussion.