-
Notifications
You must be signed in to change notification settings - Fork 9.1k
v3.2 Add data vs serialized example fields (3rd try) #4799
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
Conversation
This adds two fields to the Example Object and partially deprecates the existing `value` field. `dataValue` applies to the data that would be passed to schema validation. `serializedValue` (which MUST be a string), like `externalValue`, applies to the serialized form. Guidance is provided that `value` (and the shorthand singluar `example`) are safe for JSON serialization targets and for strings serialized to targets that do not apply further escaping, but are otherwise deprecated due to ambiguous behavior.
Co-authored-by: Ralf Handl <[email protected]>
@ralfhandl both of the issues so far should now be fixed. |
@ralfhandl sorry, one more commit as I realized I could improve the language in the other bullet points, and provide an explantation of the expected conversions involved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there 😎
Co-authored-by: Ralf Handl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it was a lot of round trips but this is a good outcome. Thank you!
This replaces PR #4671, and is the result of numerous discussions with @hudlow. Note that PR #4672 is still the update to the Example Objects examples as it required only a one-line update to conform with this PR.
This adds two fields to the Example Object and partially deprecates the existing
value
field.dataValue
applies to the data that would be passed to schema validation.serializedValue
(which MUST be a string), likeexternalValue
, applies to the serialized form.Guidance is provided that
value
(and the shorthand singluarexample
) are safe for JSON serialization targets and for strings serialized to targets that do not apply further escaping, but are otherwise deprecated due to ambiguous behavior.