Skip to content

Commit

Permalink
fix: When dataType is "Object" convert to lowercase version for as .n…
Browse files Browse the repository at this point in the history
…et type
  • Loading branch information
davidkallesen committed Jul 24, 2024
1 parent 5777e26 commit e6563c6
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,18 @@ private static List<PropertyParameters> ExtractPropertiesParameters(
{
dataType = openApiParameter.GetDataType();

if ("Object".Equals(dataType, StringComparison.Ordinal) &&
openApiParameter.AdditionalProperties is not null)
if ("Object".Equals(dataType, StringComparison.Ordinal))
{
// A defined Object with AdditionalProperties is a Dictionary - https://swagger.io/docs/specification/data-models/dictionaries/
var additionalPropertiesDataType = openApiParameter.AdditionalProperties.GetDataType();
dataType = $"Dictionary<string, {additionalPropertiesDataType}>";
if (openApiParameter.AdditionalProperties is not null)
{
// A defined Object with AdditionalProperties is a Dictionary - https://swagger.io/docs/specification/data-models/dictionaries/
var additionalPropertiesDataType = openApiParameter.AdditionalProperties.GetDataType();
dataType = $"Dictionary<string, {additionalPropertiesDataType}>";
}
else
{
dataType = "object";
}
}
}

Expand Down

0 comments on commit e6563c6

Please sign in to comment.