File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
src/Microsoft.OpenApi.Readers Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
33 <TargetFrameworks >netstandard2.0</TargetFrameworks >
4+ <LangVersion >9.0</LangVersion >
45 <GeneratePackageOnBuild >true</GeneratePackageOnBuild >
56 <PackageIconUrl >http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl >
67 <PackageProjectUrl >https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl >
Original file line number Diff line number Diff line change 1- // Copyright (c) Microsoft Corporation. All rights reserved.
1+ // Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33
44using System . Collections . Generic ;
@@ -29,7 +29,7 @@ private static void ParseMap<T>(
2929 return ;
3030 }
3131
32- var allFields = fixedFieldMap . Keys . Union ( mapNode . Select ( x => x . Name ) ) ;
32+ var allFields = fixedFieldMap . Keys . Union ( mapNode . Select ( static x => x . Name ) ) ;
3333 foreach ( var propertyNode in allFields )
3434 {
3535 mapNode [ propertyNode ] ? . ParseField ( domainObject , fixedFieldMap , patternFieldMap ) ;
@@ -78,16 +78,18 @@ private static void ProcessAnyListFields<T>(
7878 var newProperty = new List < IOpenApiAny > ( ) ;
7979
8080 mapNode . Context . StartObject ( anyListFieldName ) ;
81-
82- var list = anyListFieldMap [ anyListFieldName ] ? . PropertyGetter ( domainObject ) ;
83- if ( list != null )
81+ if ( anyListFieldMap . TryGetValue ( anyListFieldName , out var fieldName ) )
8482 {
85- foreach ( var propertyElement in list )
83+ var list = fieldName . PropertyGetter ( domainObject ) ;
84+ if ( list != null )
8685 {
87- newProperty . Add (
88- OpenApiAnyConverter . GetSpecificOpenApiAny (
89- propertyElement ,
90- anyListFieldMap [ anyListFieldName ] . SchemaGetter ( domainObject ) ) ) ;
86+ foreach ( var propertyElement in list )
87+ {
88+ newProperty . Add (
89+ OpenApiAnyConverter . GetSpecificOpenApiAny (
90+ propertyElement ,
91+ anyListFieldMap [ anyListFieldName ] . SchemaGetter ( domainObject ) ) ) ;
92+ }
9193 }
9294 }
9395
You can’t perform that action at this time.
0 commit comments