File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed
Microsoft.OpenApi.Readers
test/Microsoft.OpenApi.Readers.Tests/V3Tests Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 5
5
using SharpYaml . Serialization ;
6
6
using SharpYaml ;
7
7
using System . Globalization ;
8
- //using YamlDotNet.Core;
9
- //using YamlDotNet.RepresentationModel;
10
8
11
9
namespace Microsoft . OpenApi . Readers
12
10
{
Original file line number Diff line number Diff line change 7
7
8
8
namespace Microsoft . OpenApi . Helpers
9
9
{
10
- internal class JsonNodeCloneHelper
10
+ internal static class JsonNodeCloneHelper
11
11
{
12
12
internal static OpenApiAny Clone ( OpenApiAny value )
13
13
{
Original file line number Diff line number Diff line change @@ -85,11 +85,9 @@ public static void ValidateDataTypeMismatch(
85
85
return ;
86
86
}
87
87
88
- var anyObject = value as JsonObject ;
89
-
90
- foreach ( var property in anyObject )
88
+ if ( value is JsonObject anyObject )
91
89
{
92
- if ( anyObject != null )
90
+ foreach ( var property in anyObject )
93
91
{
94
92
context . Enter ( property . Key ) ;
95
93
if ( schema . Properties . TryGetValue ( property . Key , out var propertyValue ) )
@@ -102,7 +100,7 @@ public static void ValidateDataTypeMismatch(
102
100
}
103
101
104
102
context . Exit ( ) ;
105
- }
103
+ }
106
104
}
107
105
108
106
return ;
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.
2
2
// Licensed under the MIT license.
3
3
4
4
using System ;
@@ -1314,7 +1314,8 @@ public void HeaderParameterShouldAllowExample()
1314
1314
Type = ReferenceType . Header ,
1315
1315
Id = "example-header"
1316
1316
}
1317
- } , options => options . IgnoringCyclicReferences ( ) ) ;
1317
+ } , options => options . IgnoringCyclicReferences ( )
1318
+ . Excluding ( e => e . Example . Node . Parent ) ) ;
1318
1319
1319
1320
var examplesHeader = openApiDoc . Components ? . Headers ? [ "examples-header" ] ;
1320
1321
Assert . NotNull ( examplesHeader ) ;
@@ -1351,7 +1352,9 @@ public void HeaderParameterShouldAllowExample()
1351
1352
Type = ReferenceType . Header ,
1352
1353
Id = "examples-header"
1353
1354
}
1354
- } , options => options . IgnoringCyclicReferences ( ) ) ;
1355
+ } , options => options . IgnoringCyclicReferences ( )
1356
+ . Excluding ( e => e . Examples [ "uuid1" ] . Value . Node . Parent )
1357
+ . Excluding ( e => e . Examples [ "uuid2" ] . Value . Node . Parent ) ) ;
1355
1358
}
1356
1359
}
1357
1360
You can’t perform that action at this time.
0 commit comments