newtype-uuid
newtype-uuid copied to clipboard
draft proposal for how we might add the x-rust-type extension
@sunshowers I'm posting this as an artifact for us to discuss next week as your time permits.
It depends on the version of typify that's still unreleased so obviously would need to wait for that.
Updating this:
Rain's suggestion for a macro to define these types was something along these lines:
impl_typed_uuid_kind! {
json_schema_settings = {
crate = "my-crate",
path = "my_crate",
};
Collection => { version = "0.1.0", tag = "collection", kind = CollectionKind, short = CollectionUuid },
Downstairs => { version = "0.1.0", tag = "downstairs", kind = DownstairsKind, short = DownstairsUuid },
// ...
}
We might simplify that a bit to make it easier to parse with serde_tokenstream, but that's the general idea.
This would still be wonderful.