Skip to content

Commit

Permalink
Fixes bug where the schema copy constructor would run into a stack ov…
Browse files Browse the repository at this point in the history
…erflow due to wrong copying of AdditionalProperties object
  • Loading branch information
MaggieKimani1 committed Dec 6, 2022
1 parent 7144013 commit 043a592
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Models/OpenApiSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public OpenApiSchema(OpenApiSchema schema)
MaxProperties = schema?.MaxProperties ?? MaxProperties;
MinProperties = schema?.MinProperties ?? MinProperties;
AdditionalPropertiesAllowed = schema?.AdditionalPropertiesAllowed ?? AdditionalPropertiesAllowed;
AdditionalProperties = new(schema?.AdditionalProperties);
AdditionalProperties = schema?.AdditionalProperties != null ? new(schema?.AdditionalProperties) : null;
Discriminator = schema?.Discriminator != null ? new(schema?.Discriminator) : null;
Example = OpenApiAnyCloneHelper.CloneFromCopyConstructor(schema?.Example);
Enum = schema?.Enum != null ? new List<IOpenApiAny>(schema.Enum) : null;
Expand Down

0 comments on commit 043a592

Please sign in to comment.