-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
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
serde_yaml::Value
does not perfectly round trip serialize.
#1048
Comments
What is the current state of discussion with respect to YAML? If we are moving to JSON (or at least away from YAML) anyway, there would be nothing to do for this issue. Tagged values are a really nice feature of YAML that is unfortunately missing in JSON. Therefore JSON formats always have to make up their own encoding of tags, and there isn't a universally agreed upon way to do this. Msgpack has extensions, but they are not quite the same as tagged values, and there does not appear to be an standardised extension for tagged values. Therefore msgpack would do a similar encoding as JSON. The Rust ecosystem of YAML libraries is in an unfortunate state. In particular, the There is an additional option: Use a custom |
To be clear, the issue here is that the rust types I suggest that we change to using
I do not think it's settled, we do not have any declaritive-spec users yet I don't think. My view is that we should continue to accept yaml, possibly gated by a feature flag, and immediately convert to json on ingress, failing if there are any
Agree, but we specify everything with
I think you mean |
Closes #1048 BREAKING_CHANGE: use `serde_json::Value` rather than `serde_yaml::Value` in `CustomSerialized`, `CustomTypeArg`, `OpDef`, `OperationDeclaration`
Closes #1048 BREAKING_CHANGE: use `serde_json::Value` rather than `serde_yaml::Value` in `CustomSerialized`, `CustomTypeArg`, `OpDef`, `OperationDeclaration`
Closes #1048 BREAKING CHANGE: use `serde_json::Value` rather than `serde_yaml::Value` in `CustomSerialized`, `OpDef`, `OperationDeclaration` --------- Co-authored-by: Douglas Wilson <[email protected]>
In paticular https://docs.rs/serde_yaml/latest/serde_yaml/value/struct.TaggedValue.html is deserialized as a
Mapping
. Observe this by uncommenting the generator incrate::proptest::any_serde_value
(currently in review #981).Ideas:
serde_json::Value
for our "opaque" representation inCustomSerialized
,CustomTypeArg
, etc. we already useserde_json::Value
for metadata.TaggedValue
s.The text was updated successfully, but these errors were encountered: