Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit1633453

Browse files
authored
Merge pull request#2521 from microsoft/baywet-patch-1
fix: typo in allowReserved property name for deserialization
2 parents43282ec +f7e34be commit1633453

File tree

1 file changed

+52
-54
lines changed

1 file changed

+52
-54
lines changed
Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,74 @@
11
usingSystem;
22

3-
namespaceMicrosoft.OpenApi.Reader.V31
3+
namespaceMicrosoft.OpenApi.Reader.V31;
4+
/// <summary>
5+
/// Class containing logic to deserialize Open API V31 document into
6+
/// runtime Open API object model.
7+
/// </summary>
8+
internalstaticpartialclassOpenApiV31Deserializer
49
{
5-
/// <summary>
6-
/// Class containing logic to deserialize Open API V31 document into
7-
/// runtime Open API object model.
8-
/// </summary>
9-
internalstaticpartialclassOpenApiV31Deserializer
10+
privatestaticreadonlyFixedFieldMap<OpenApiEncoding>_encodingFixedFields=new()
1011
{
11-
privatestaticreadonlyFixedFieldMap<OpenApiEncoding>_encodingFixedFields=new()
1212
{
13+
"contentType",(o,n,_)=>
1314
{
14-
"contentType",(o,n,_)=>
15-
{
16-
o.ContentType=n.GetScalarValue();
17-
}
18-
},
15+
o.ContentType=n.GetScalarValue();
16+
}
17+
},
18+
{
19+
"headers",(o,n,t)=>
1920
{
20-
"headers",(o,n,t)=>
21-
{
22-
o.Headers=n.CreateMap(LoadHeader,t);
23-
}
24-
},
21+
o.Headers=n.CreateMap(LoadHeader,t);
22+
}
23+
},
24+
{
25+
"style",(o,n,_)=>
2526
{
26-
"style",(o,n,_)=>
27+
if(!n.GetScalarValue().TryGetEnumFromDisplayName<ParameterStyle>(n.Context,outvarstyle))
2728
{
28-
if(!n.GetScalarValue().TryGetEnumFromDisplayName<ParameterStyle>(n.Context,outvarstyle))
29-
{
30-
return;
31-
}
32-
o.Style=style;
29+
return;
3330
}
34-
},
31+
o.Style=style;
32+
}
33+
},
34+
{
35+
"explode",(o,n,_)=>
3536
{
36-
"explode",(o,n,_)=>
37+
varexplode=n.GetScalarValue();
38+
if(explodeis notnull)
3739
{
38-
varexplode=n.GetScalarValue();
39-
if(explodeis notnull)
40-
{
41-
o.Explode=bool.Parse(explode);
42-
}
43-
}
44-
},
40+
o.Explode=bool.Parse(explode);
41+
}
42+
}
43+
},
44+
{
45+
"allowReserved",(o,n,_)=>
4546
{
46-
"allowReserved",(o,n,_)=>
47+
varallowReserved=n.GetScalarValue();
48+
if(allowReservedis notnull)
4749
{
48-
varallowReserved=n.GetScalarValue();
49-
if(allowReservedis notnull)
50-
{
51-
o.AllowReserved=bool.Parse(allowReserved);
52-
}
50+
o.AllowReserved=bool.Parse(allowReserved);
5351
}
54-
},
55-
};
56-
57-
privatestaticreadonlyPatternFieldMap<OpenApiEncoding>_encodingPatternFields=
58-
new()
59-
{
60-
{s=>s.StartsWith(OpenApiConstants.ExtensionFieldNamePrefix,StringComparison.OrdinalIgnoreCase),(o,p,n,_)=>o.AddExtension(p,LoadExtension(p,n))}
61-
};
52+
}
53+
},
54+
};
6255

63-
publicstaticOpenApiEncodingLoadEncoding(ParseNodenode,OpenApiDocumenthostDocument)
56+
privatestaticreadonlyPatternFieldMap<OpenApiEncoding>_encodingPatternFields=
57+
new()
6458
{
65-
varmapNode=node.CheckMapNode("encoding");
59+
{s=>s.StartsWith(OpenApiConstants.ExtensionFieldNamePrefix,StringComparison.OrdinalIgnoreCase),(o,p,n,_)=>o.AddExtension(p,LoadExtension(p,n))}
60+
};
6661

67-
varencoding=newOpenApiEncoding();
68-
foreach(varpropertyinmapNode)
69-
{
70-
property.ParseField(encoding,_encodingFixedFields,_encodingPatternFields,hostDocument);
71-
}
62+
publicstaticOpenApiEncodingLoadEncoding(ParseNodenode,OpenApiDocumenthostDocument)
63+
{
64+
varmapNode=node.CheckMapNode("encoding");
7265

73-
returnencoding;
66+
varencoding=newOpenApiEncoding();
67+
foreach(varpropertyinmapNode)
68+
{
69+
property.ParseField(encoding,_encodingFixedFields,_encodingPatternFields,hostDocument);
7470
}
71+
72+
returnencoding;
7573
}
7674
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp