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
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
18 changes: 13 additions & 5 deletions 18 src/Microsoft.OpenApi.Readers/V2/OpenApiHeaderDeserializer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System;
Expand Down Expand Up @@ -139,8 +139,12 @@ internal static partial class OpenApiV2Deserializer
{
OpenApiConstants.Default,
new AnyFieldMapParameter<OpenApiHeader>(
p => p.Schema.Default,
(p, v) => p.Schema.Default = v,
p => p.Schema?.Default,
(p, v) =>
{
if(p.Schema == null) return;
p.Schema.Default = v;
},
p => p.Schema)
}
};
Expand All @@ -151,8 +155,12 @@ internal static partial class OpenApiV2Deserializer
{
OpenApiConstants.Enum,
new AnyListFieldMapParameter<OpenApiHeader>(
p => p.Schema.Enum,
(p, v) => p.Schema.Enum = v,
p => p.Schema?.Enum,
(p, v) =>
{
if(p.Schema == null) return;
p.Schema.Enum = v;
},
p => p.Schema)
},
};
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.