10 releases
0.1.9 | Jan 22, 2025 |
---|---|
0.1.8 | Jan 22, 2025 |
#691 in Encoding
524 downloads per month
Used in 2 crates
6KB
101 lines
MaybeReference
This is a utility crate that establishes an enum to use to match a JSON value that may be a single string (a "reference"), a reference in the form of {"id": "reference"}
or an object.
"https://example.com/id/uuid"
{"id": "reference"}
{"id": "reference", "content": "somecontent"}
These would all match to MaybeReference<String> as ::Reference, ::Identifier, ::Actual, respectively.
Dependencies
~2.8–5MB
~89K SLoC