Fix OpenApiPathsMapper (#1122)

* Fix OpenApiPathsMapper

* utc

* s
This commit is contained in:
Stef Heyenrath
2024-07-22 21:36:45 +02:00
committed by GitHub
parent 422e7c9b5e
commit d79f6f128d
7 changed files with 38778 additions and 37 deletions

View File

@@ -193,7 +193,8 @@ internal class OpenApiPathsMapper
}
else
{
jArray.Add(MapSchemaToObject(schema.Items, name));
var arrayItem = MapSchemaToObject(schema.Items, name: null); // Set name to null to force JObject instead of JProperty
jArray.Add(arrayItem);
}
}
@@ -219,12 +220,9 @@ internal class OpenApiPathsMapper
if (schema.AllOf.Count > 0)
{
foreach (var property in schema.AllOf)
foreach (var group in schema.AllOf.SelectMany(p => p.Properties).GroupBy(x => x.Key))
{
foreach (var item in property.Properties)
{
propertyAsJObject.Add(MapPropertyAsJObject(item.Value, item.Key));
}
propertyAsJObject.Add(MapPropertyAsJObject(group.First().Value, group.Key));
}
}