schemars icon indicating copy to clipboard operation
schemars copied to clipboard

Support for serde_json::RawValue

Open luke-biel opened this issue 3 years ago • 4 comments
trafficstars

It seems that there's no support for serde_json::value::RawValue, which seems a bit odd.

error[E0277]: the trait bound `serde_json::value::RawValue: JsonSchema` is not satisfied
    |
62  |         component: Box<RawValue>,
    |                    ^^^ the trait `JsonSchema` is not implemented for `serde_json::value::RawValue`
    |
    = note: required because of the requirements on the impl of `JsonSchema` for `Box<serde_json::value::RawValue>`

luke-biel avatar Jun 10 '22 13:06 luke-biel

It indeed seems to be missing. https://github.com/GREsau/schemars/blob/master/schemars/src/json_schema_impls/serdejson.rs

PR is welcome.

ralpha avatar Jun 11 '22 12:06 ralpha

What would you expect that JSON schema to be for RawValue? Same as Value?

ahl avatar Jul 19 '22 15:07 ahl

@ahl Yes, my assumption is that it would work same as Value.

luke-biel avatar Aug 02 '22 09:08 luke-biel

+1

gahag-cw avatar Aug 16 '22 17:08 gahag-cw