We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"maximum"
In the following JSON schema, all three ByteCountN variants have the same type and format, and only differ by maximum:
ByteCountN
type
format
maximum
ByteCount1
ByteCount2
i64::MAX
ByteCount3
i64::MAX + 1
{ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "ByteCount1": { "description": "Byte count to express memory or storage capacity.", "type": "integer", "format": "uint64", "minimum": 0 }, "ByteCount2": { "description": "Byte count to express memory or storage capacity.", "type": "integer", "format": "uint64", "minimum": 0, "maximum": 9223372036854775807 }, "ByteCount3": { "description": "Byte count to express memory or storage capacity.", "type": "integer", "format": "uint64", "minimum": 0, "maximum": 9223372036854775808 } } }
I expected all of these to produce a struct wrapping a u64, but ByteCount{2,3} use i64 instead:
u64
ByteCount{2,3}
i64
% cargo typify bytecount.json && rg 'struct ByteCount' bytecount.rs 48:pub struct ByteCount1(pub u64); 114:pub struct ByteCount2(pub i64); 180:pub struct ByteCount3(pub i64);
The text was updated successfully, but these errors were encountered:
Oof.. ByteCount3 seems particularly stupid.
Sorry, something went wrong.
@ahl did you manage to create a fix for this?
fixes oxidecomputer#589 allow min and max to be within range
ce97c07
ahl
Successfully merging a pull request may close this issue.
In the following JSON schema, all three
ByteCountN
variants have the sametype
andformat
, and only differ bymaximum
:ByteCount1
omitsmaximum
ByteCount2
sets itsmaximum
toi64::MAX
ByteCount3
sets itsmaximum
toi64::MAX + 1
I expected all of these to produce a struct wrapping a
u64
, butByteCount{2,3}
usei64
instead:The text was updated successfully, but these errors were encountered: