Add JsonSchema
impls for BytesOrString
and BoolFromInt
#683
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR continues where #679 left off. Since the impls get more complicated as we go on I will be chunking them up into smaller PRs so that reviewing them stays manageable. I also don't plan on doing more than 1 or maybe 2 PRs concurrently. I just considered #682 important enough that it should jump the queue.
Details
JsonSchemaFor
impls for bothBytesOrString
andBoolFromInt
Notes
BytesOrString
's schema is represented as an enum that can be either a string or an array of bytes. The one difference is that the string representation is marked as "writeOnly" as it is never emitted.BoolFromInt<Flexible>
but I didn't think that this was useful compared to the extra confusion when reading the schema. I have changed it so it's schema is just that of an integer.