A better Rust ATProto crate

lexgen: generate actual enums for enum strings #29

open opened by blooym.dev

Right now the generator will see the following and generate a Cowstr that isn't validated to be one of the possible closed values instead of a type safe enum.

"sortBy": {
   "type": "string",
   "enum": ["newest", "oldest", "top"],
   "default": "newest"
}

It would be a major improvement to change this behaviour.

Looking deeper I see that an unreleased commit did some implementation for knownValues, however this does not seem to lead to an open enum generation on query types, and possibly procedures too. It also is still not quite ideal as it's an open enum instead of a closed one.

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:p5yjdr64h7mk5l3kh6oszryk/sh.tangled.repo.issue/3md2grmzix722