A human-friendly DSL for ATProto Lexicons
27
fork

Configure Feed

Select the types of activity you want to include in your feed.

Nested constraints Lexicon to MLF #7

open opened by vmx.cx

Here's a minimal example of where Lexicon to MLF conversion fails when there are constraints on the items of an array,

{
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "id": "com.example.minimal",
  "defs": {
    "main": {
      "type": "record",
      "description": "",
      "key": "tid",
      "record": {
        "type": "object",
        "required": [],
        "properties": {
          "tags": {
            "type": "ref",
            "ref": "#tags"
          }
        }
      }
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "maxLength": 20
    }
  }
}

The current output is:

@main
record minimal {
    tags: tags,
}

def type tags = string[] constrained {
        maxLength: 20,
    };

But it should rather be something like:

@main
record minimal {
    tags: tags,
}

def type tags = (string constrained {
    minLength: 1,
    maxLength: 200,
  })[] constrained {
    maxLength: 20,
};
[deleted by author]
sign up or login to add to the discussion
Labels

None yet.

assignee
Participants 2
AT URI
at://did:plc:3mdq56yhyqq5k6d4guztheaf/sh.tangled.repo.issue/3mjeyl63rst22