Support edge case: first object, next an array. (#643)

This commit is contained in:
Daniel L. Romero
2021-10-06 10:18:46 -05:00
committed by GitHub
parent 72eec7140b
commit 34083d826e

View File

@@ -152,13 +152,17 @@ namespace WireMock.Net.OpenApiParser.Mappers
{
string propertyName = schemaProperty.Key;
var openApiSchema = schemaProperty.Value;
if (openApiSchema.GetSchemaType() == SchemaType.Object)
if (openApiSchema.GetSchemaType() == SchemaType.Object || openApiSchema.GetSchemaType() == SchemaType.Array)
{
var mapped = MapSchemaToObject(schemaProperty.Value, schemaProperty.Key);
if (mapped is JProperty jp)
{
propertyAsJObject.Add(jp);
}
else
{
propertyAsJObject.Add(new JProperty(schemaProperty.Key, mapped));
}
}
else
{