Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add comment to createDiscriminator
  • Loading branch information
ahmednfwela committed Jan 2, 2023
commit b6b5a6d6dc51eaee2e3d25f757f94c36fdf35f1c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ private void adaptToDartInheritance(Map<String, ModelsMap> objs) {
}
}

/// override the default behavior of createDiscriminator
/// to remove extra mappings added as a side effect of setLegacyDiscriminatorBehavior(false)
/// this ensures 1-1 schema mapping instead of 1-many
@Override
protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI) {
CodegenDiscriminator sub = super.createDiscriminator(schemaName, schema, openAPI);
Expand Down