Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Oct 11, 2023
1 parent 0d8f18d commit c5bc8d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ internal static partial class OpenApiV2Deserializer
private static FixedFieldMap<OpenApiDocument> _openApiFixedFields = new()
{
{
"swagger", (_, _) =>
{
} /* Version is valid field but we already parsed it */
"swagger", (_, _) => {}
/* Version is valid field but we already parsed it */
},
{"info", (o, n) => o.Info = LoadInfo(n)},
{"host", (_, n) => n.Context.SetTempStorage("host", n.GetScalarValue())},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,18 @@ internal static partial class OpenApiV2Deserializer
{"name", (o, n) => o.Name = n.GetScalarValue()},
{"in", (o, n) => o.In = n.GetScalarValue().GetEnumFromDisplayName<ParameterLocation>()},
{
"flow", (_, n) =>
{
_flowValue = n.GetScalarValue();
}
"flow", (_, n) => _flowValue = n.GetScalarValue()
},
{
"authorizationUrl",
(_, n) =>
{
_flow.AuthorizationUrl = new(n.GetScalarValue(), UriKind.RelativeOrAbsolute);
}
(_, n) => _flow.AuthorizationUrl = new(n.GetScalarValue(), UriKind.RelativeOrAbsolute)
},
{
"tokenUrl",
(_, n) =>
{
_flow.TokenUrl = new(n.GetScalarValue(), UriKind.RelativeOrAbsolute);
}
(_, n) => _flow.TokenUrl = new(n.GetScalarValue(), UriKind.RelativeOrAbsolute)
},
{
"scopes", (_, n) =>
{
_flow.Scopes = n.CreateSimpleMap(LoadString);
}
"scopes", (_, n) => _flow.Scopes = n.CreateSimpleMap(LoadString)
}
};

Expand Down
4 changes: 1 addition & 3 deletions src/Microsoft.OpenApi/Models/OpenApiComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ public void SerializeAsV3(IOpenApiWriter writer)
writer.WriteOptionalMap(
OpenApiConstants.Schemas,
Schemas,
(w, _, component) => {
component.SerializeAsV3WithoutReference(w);
});
(w, _, component) => component.SerializeAsV3WithoutReference(w));
}
writer.WriteEndObject();
return;
Expand Down
5 changes: 1 addition & 4 deletions src/Microsoft.OpenApi/Models/OpenApiDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,7 @@ public void SerializeAsV2(IOpenApiWriter writer)
writer.WriteOptionalMap(
OpenApiConstants.Definitions,
openApiSchemas,
(w, _, component) =>
{
component.SerializeAsV2WithoutReference(w);
});
(w, _, component) => component.SerializeAsV2WithoutReference(w));
}
}
else
Expand Down

0 comments on commit c5bc8d9

Please sign in to comment.