You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional unit tests for OpenAPIObjectContainer (#24)
### Motivation
Trying to encode an `OpenAPIValueContainer` would previously throw an
`EncodingError` if the untyped container contained nested dictionary or
array structures. (e.g. `{"dict": {"foo": "bar"}}`) Data could be
decoded into this format, but it could not be re-encoded successfully.
### Modifications
When encoding the value of a nested JSON array or object in
`OpenAPIValueContainer`, we now handle arrays and dicts by wrapping the
inner value in `OpenAPIValueContainer` before passing it to the encoder.
(note: Based on the rest of the `encode()` implementation, it seems that
this may have been expected to happen previously during decoding. Let me
know if making changes on the decode side of things is preferable.)
### Result
Additional unit tests added to validate that encoder generates correct
output for nested data structures in `OpenAPIValueContainer`, and that
these data structures can be decoded and successfully re-endcoded
afterward.
### Test Plan
Run `Test_CodableExtensions` tests, see all tests pass.
Co-authored-by: Honza Dvorsky <[email protected]>
0 commit comments