A better Rust ATProto crate

lexgen: LexBlob fields are always None, even when lexicon sets them. #28

open opened by blooym.dev edited

I define some standard fields on my gif blobs in my lexicon as follows:

    "gif": {
      "type": "object",
      "properties": {
        "alt": {
          "type": "string"
        },
        "blob": {
          "type": "blob",
          "accept": ["image/gif"],
          "maxSize": 2000000
        }
      },
      "required": ["blob"]
    }

However when I check the types generated with jacquard-lexgen I see that all the fields are set to None:

map.insert(
    ::jacquard_common::smol_str::SmolStr::new_static("blob"),
    ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob {
        description: None,
        accept: None,
        max_size: None,
    }),
);

Ideally these would be set correctly as I intended to read these from my generated types to perform some additional validations. I'm not sure if this is user error or an issue with the generator

that's probably an oversight in the generator, forgot to add the description stuff to that code path for the validator. regarding the at-uri issue from the gc, I need to look in more detail, but in general it will give you the type.

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:p5yjdr64h7mk5l3kh6oszryk/sh.tangled.repo.issue/3mco5hvhaq622