-
Notifications
You must be signed in to change notification settings - Fork 223
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
tsp-openapi3 - improve model generation of schemas using allOf #4232
tsp-openapi3 - improve model generation of schemas using allOf #4232
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
…soft#4232) Fixes microsoft#4152 Depends on microsoft#4216 This PR updates how tsp-openapi3 handles generating models for schemas that use `allOf`. Currently `allOf` is ignored unless there is only 1 member and that member is a schema reference. In this scenario, the model extends the single member. This update now takes all of the schema `allOf` members into consideration when generating a model. - inline-schemas have their properties merged into the model's properties - schema references without a discriminator defined are spread into the model - if only 1 schema reference contains a discriminator, then the model extends it, otherwise these schema references are spread as well. --------- Co-authored-by: Christopher Radek <Christopher.Radek@microsoft.com>
…soft#4232) Fixes microsoft#4152 Depends on microsoft#4216 This PR updates how tsp-openapi3 handles generating models for schemas that use `allOf`. Currently `allOf` is ignored unless there is only 1 member and that member is a schema reference. In this scenario, the model extends the single member. This update now takes all of the schema `allOf` members into consideration when generating a model. - inline-schemas have their properties merged into the model's properties - schema references without a discriminator defined are spread into the model - if only 1 schema reference contains a discriminator, then the model extends it, otherwise these schema references are spread as well. --------- Co-authored-by: Christopher Radek <Christopher.Radek@microsoft.com>
Fixes #4152
Depends on #4216
This PR updates how tsp-openapi3 handles generating models for schemas that use
allOf
.Currently
allOf
is ignored unless there is only 1 member and that member is a schema reference. In this scenario, the model extends the single member.This update now takes all of the schema
allOf
members into consideration when generating a model.