Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal static partial class OpenApiV2Deserializer
"consumes", (o, n) => {
var consumes = n.CreateSimpleList(s => s.GetScalarValue());
if (consumes.Count > 0) {
n.Context.SetTempStorage(TempStorageKeys.OperationConsumes,consumes);
n.Context.SetTempStorage(TempStorageKeys.OperationConsumes,consumes);
}
}
},
Expand Down
24 changes: 0 additions & 24 deletions 24 src/Microsoft.OpenApi.Readers/V2/OpenApiV2VersionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,6 @@ private static ReferenceType ParseReferenceType(string referenceTypeName)
}
}

private static string GetReferenceTypeV2Name(ReferenceType referenceType)
{
switch (referenceType)
{
case ReferenceType.Schema:
return "definitions";

case ReferenceType.Parameter:
return "parameters";

case ReferenceType.Response:
return "responses";

case ReferenceType.Tag:
return "tags";

case ReferenceType.SecurityScheme:
return "securityDefinitions";

default:
throw new ArgumentException();
}
}

private static ReferenceType GetReferenceTypeV2FromName(string referenceType)
{
switch (referenceType)
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Microsoft.OpenApi/Models/OpenApiSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -700,12 +700,12 @@ internal void WriteAsSchemaProperties(
if (AllOf == null || AllOf.Count == 0)
{
// anyOf (Not Supported in V2) - Write the first schema only as an allOf.
writer.WriteOptionalCollection(OpenApiConstants.AllOf, AnyOf.Take(1), (w, s) => s.SerializeAsV2(w));
writer.WriteOptionalCollection(OpenApiConstants.AllOf, AnyOf?.Take(1), (w, s) => s.SerializeAsV2(w));

if (AnyOf == null || AnyOf.Count == 0)
{
// oneOf (Not Supported in V2) - Write the first schema only as an allOf.
writer.WriteOptionalCollection(OpenApiConstants.AllOf, OneOf.Take(1), (w, s) => s.SerializeAsV2(w));
writer.WriteOptionalCollection(OpenApiConstants.AllOf, OneOf?.Take(1), (w, s) => s.SerializeAsV2(w));
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.