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
I will try to build a minimal repro if needed but for now ill take an exerpt from my generated model. I have several objects that are referenced in a oneOf property with the same discriminator. The template generated by @openapi-generator-plus/typescript-fetch-node-client-generator will repeat this property multiple times.
e.g.
export interface InboxAssessment {
/**
* Value for discriminator in Api.Assessment.Section
*/
tag: Api.InboxAssessment.TagEnum.InboxAssessment;
/**
* Value for discriminator in Api.FacilitatorQuestions.Question
*/
tag: Api.InboxAssessment.TagEnum.InboxAssessment;
/**
* Value for discriminator in Api.AssessorQuestions.Question
*/
tag: Api.InboxAssessment.TagEnum.InboxAssessment;
sectionId: string;
rank: string;
orgchart: Api.Attachment;
items: Api.InboxAssessment.Item[];
}
I would like to ignore the discriminator all together and include it in the object def instead of going through the 'parent' object. Ideally the parent is specifying a discriminated union but each containing object is unaware of the 'parent' contexts that it is used in.
My questions are
is this a bug in openapi-generator-plus?
is there a simple way to remove the discriminator specific logic in template overrides and just add the prop as specified in the model (in this case, InboxAssessment)
for my own understanding (and so I can submit a pull request if this behavior is indeed buggy) what is the scenario where we would want to loop through the discriminators?
The text was updated successfully, but these errors were encountered:
@aherrmann13 I have come across this myself now... I think this is a problem in the generated code... but it's a little difficult to solve in some cases. Have worked out an approach for this?
I will try to build a minimal repro if needed but for now ill take an exerpt from my generated model. I have several objects that are referenced in a
oneOf
property with the same discriminator. The template generated by@openapi-generator-plus/typescript-fetch-node-client-generator
will repeat this property multiple times.e.g.
I would like to ignore the discriminator all together and include it in the object def instead of going through the 'parent' object. Ideally the parent is specifying a discriminated union but each containing object is unaware of the 'parent' contexts that it is used in.
My questions are
InboxAssessment
)The text was updated successfully, but these errors were encountered: