Skip to content

Commit

Permalink
Fix codegen for polymorphic arrays (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT authored Jun 15, 2020
1 parent 469d158 commit 28e074d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/generator/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ function generateStructs(objects?: ObjectSchema[]): StructDef[] {
if (isObjectSchema(each.schema)) {
return each.schema.discriminator !== undefined;
}
if (isArraySchema(each.schema) && isObjectSchema(each.schema.elementType)) {
return each.schema.elementType.discriminator !== undefined;
}
return false;
});
if (obj.language.go!.errorType) {
Expand Down

0 comments on commit 28e074d

Please sign in to comment.