Skip to content

Conversation

@cyclops23
Copy link
Contributor

When combining elements using allOf the required fields should be passed through so that the ts definitions do not define a required field in the child object as optional.

I limited the scope of the changes to COMPLEX_ALL_OF as that is my use case, but happy to expand to other complex types for consistency if it makes sense.

@hedgepigdaniel
Copy link
Contributor

Thanks for this, I had a similar problem!

I extended it to also work with anyOf and oneOf, but in the process I also found a bug in this change, where it can type fields as required when in fact they are not required.

See #342 (comment) for an explanation.

@cyclops23
Copy link
Contributor Author

Closing in favour of #342

@cyclops23 cyclops23 closed this Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants