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
Describe the bug
This only seems to be an issue when using oneOf nested inside a field or an array (i.e not at the top-level) AND where a oneOf subschema contains a field that uses a default value.
Under these circumstances, it seems like the default values aren't being populated automatically. This seems to happen even if a discriminator is used.
To Reproduce
Use oneOf to describe a field or array (Note: I have a proper example below) e.g
Actual behavior
When POSTing to an endpoint using this spec, the default value for the field is not populated.
Expected behavior
I would expect the default value to be populated, as this is the behavior using this field in other contexts.
Examples and context
I pushed up an example to a forked version of this repo, which you can use to see the changes I made (see here) to test this out.
I was also unsure if this is related to this comment here about only supporting top-level discriminators. However, I wasn't sure because I'm not using discriminators in my example.
The text was updated successfully, but these errors were encountered:
@kiahnjl thanks for this issue. and thanks for your interest. currently, only top level discriminators are supported. in this case its nested. I'm going to close this, as we've have other issues that account for this csae. i.e. #104, et la
Describe the bug
This only seems to be an issue when using
oneOf
nested inside a field or an array (i.e not at the top-level) AND where aoneOf
subschema contains a field that uses adefault
value.Under these circumstances, it seems like the
default
values aren't being populated automatically. This seems to happen even if adiscriminator
is used.To Reproduce
Use
oneOf
to describe a field or array (Note: I have a proper example below) e.gAdd a default value to one of the subschemas e.g
Actual behavior
When POSTing to an endpoint using this spec, the
default
value for the field is not populated.Expected behavior
I would expect the
default
value to be populated, as this is the behavior using this field in other contexts.Examples and context
I pushed up an example to a forked version of this repo, which you can use to see the changes I made (see here) to test this out.
I was also unsure if this is related to this comment here about only supporting top-level discriminators. However, I wasn't sure because I'm not using discriminators in my example.
The text was updated successfully, but these errors were encountered: