Skip to content

Commit 96e7f71

Browse files
authored
Merge pull request #887 from microsoft/fix/safe-oainet-version
fix: updates openapi.net to a non-vulnerable version
2 parents 516f5b5 + f85f890 commit 96e7f71

6 files changed

Lines changed: 192 additions & 31 deletions

File tree

‎src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3333
</PackageReference>
3434
<PackageReference Include="Microsoft.OData.Edm" Version="8.3.0" />
35-
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0" />
35+
<PackageReference Include="Microsoft.OpenApi" Version="2.12.2" />
3636
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
3737
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15">
3838
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

‎test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ public async Task CreateStructuredTypePropertiesSchemaWithCustomAttributeReturns
391391
""$ref"": ""#/components/schemas/microsoft.graph.userInsightsSettings""
392392
},
393393
{
394+
""enum"": [
395+
null
396+
],
394397
""nullable"": true
395398
}
396399
],
@@ -403,6 +406,9 @@ public async Task CreateStructuredTypePropertiesSchemaWithCustomAttributeReturns
403406
""$ref"": ""#/components/schemas/microsoft.graph.contactMergeSuggestions""
404407
},
405408
{
409+
""enum"": [
410+
null
411+
],
406412
""nullable"": true
407413
}
408414
],
@@ -415,6 +421,9 @@ public async Task CreateStructuredTypePropertiesSchemaWithCustomAttributeReturns
415421
""$ref"": ""#/components/schemas/microsoft.graph.regionalAndLanguageSettings""
416422
},
417423
{
424+
""enum"": [
425+
null
426+
],
418427
""nullable"": true
419428
}
420429
],
@@ -427,6 +436,9 @@ public async Task CreateStructuredTypePropertiesSchemaWithCustomAttributeReturns
427436
""$ref"": ""#/components/schemas/microsoft.graph.shiftPreferences""
428437
},
429438
{
439+
""enum"": [
440+
null
441+
],
430442
""nullable"": true
431443
}
432444
],
@@ -907,7 +919,8 @@ public async Task CreatePropertySchemaForNullableEnumPropertyReturnSchema(OpenAp
907919
string json = await schema.SerializeAsJsonAsync(specVersion);
908920
_output.WriteLine(json);
909921

910-
var expected = JsonNode.Parse(specVersion switch {
922+
var expected = JsonNode.Parse(specVersion switch
923+
{
911924
OpenApiSpecVersion.OpenApi2_0 =>
912925
"""
913926
{
@@ -922,6 +935,9 @@ public async Task CreatePropertySchemaForNullableEnumPropertyReturnSchema(OpenAp
922935
"$ref": "#/components/schemas/DefaultNs.Color"
923936
},
924937
{
938+
"enum": [
939+
null
940+
],
925941
"nullable": true
926942
}
927943
],

‎test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5016,6 +5016,9 @@
50165016
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
50175017
},
50185018
{
5019+
"enum": [
5020+
null
5021+
],
50195022
"nullable": true
50205023
}
50215024
],
@@ -5364,6 +5367,9 @@
53645367
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library"
53655368
},
53665369
{
5370+
"enum": [
5371+
null
5372+
],
53675373
"nullable": true
53685374
}
53695375
],
@@ -5375,6 +5381,9 @@
53755381
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.DocumentFile.DocumentFile"
53765382
},
53775383
{
5384+
"enum": [
5385+
null
5386+
],
53785387
"nullable": true
53795388
}
53805389
],
@@ -5386,6 +5395,9 @@
53865395
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
53875396
},
53885397
{
5398+
"enum": [
5399+
null
5400+
],
53895401
"nullable": true
53905402
}
53915403
],
@@ -5535,6 +5547,9 @@
55355547
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
55365548
},
55375549
{
5550+
"enum": [
5551+
null
5552+
],
55385553
"nullable": true
55395554
}
55405555
],
@@ -5605,6 +5620,9 @@
56055620
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
56065621
},
56075622
{
5623+
"enum": [
5624+
null
5625+
],
56085626
"nullable": true
56095627
}
56105628
],
@@ -5616,6 +5634,9 @@
56165634
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Tags.Tag"
56175635
},
56185636
{
5637+
"enum": [
5638+
null
5639+
],
56195640
"nullable": true
56205641
}
56215642
],
@@ -5864,6 +5885,9 @@
58645885
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library"
58655886
},
58665887
{
5888+
"enum": [
5889+
null
5890+
],
58675891
"nullable": true
58685892
}
58695893
],
@@ -5875,6 +5899,9 @@
58755899
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType"
58765900
},
58775901
{
5902+
"enum": [
5903+
null
5904+
],
58785905
"nullable": true
58795906
}
58805907
],
@@ -5886,6 +5913,9 @@
58865913
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library"
58875914
},
58885915
{
5916+
"enum": [
5917+
null
5918+
],
58895919
"nullable": true
58905920
}
58915921
],
@@ -6064,6 +6094,9 @@
60646094
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType"
60656095
},
60666096
{
6097+
"enum": [
6098+
null
6099+
],
60676100
"nullable": true
60686101
}
60696102
],
@@ -6075,6 +6108,9 @@
60756108
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType"
60766109
},
60776110
{
6111+
"enum": [
6112+
null
6113+
],
60786114
"nullable": true
60796115
}
60806116
],
@@ -6590,6 +6626,9 @@
65906626
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
65916627
},
65926628
{
6629+
"enum": [
6630+
null
6631+
],
65936632
"nullable": true
65946633
}
65956634
],

‎test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml‎

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3528,7 +3528,9 @@ components:
35283528
Document:
35293529
anyOf:
35303530
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document'
3531-
- nullable: true
3531+
- enum:
3532+
- null
3533+
nullable: true
35323534
x-ms-navigationProperty: true
35333535
example:
35343536
Id: 0
@@ -3805,17 +3807,23 @@ components:
38053807
Library:
38063808
anyOf:
38073809
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library'
3808-
- nullable: true
3810+
- enum:
3811+
- null
3812+
nullable: true
38093813
x-ms-navigationProperty: true
38103814
LastRevisionFile:
38113815
anyOf:
38123816
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.DocumentFile.DocumentFile'
3813-
- nullable: true
3817+
- enum:
3818+
- null
3819+
nullable: true
38143820
x-ms-navigationProperty: true
38153821
SourceDocument:
38163822
anyOf:
38173823
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document'
3818-
- nullable: true
3824+
- enum:
3825+
- null
3826+
nullable: true
38193827
x-ms-navigationProperty: true
38203828
SourceDocumentChildren:
38213829
type: array
@@ -3928,7 +3936,9 @@ components:
39283936
Document:
39293937
anyOf:
39303938
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document'
3931-
- nullable: true
3939+
- enum:
3940+
- null
3941+
nullable: true
39323942
x-ms-navigationProperty: true
39333943
example:
39343944
ClassInstance: 0
@@ -3981,12 +3991,16 @@ components:
39813991
Document:
39823992
anyOf:
39833993
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document'
3984-
- nullable: true
3994+
- enum:
3995+
- null
3996+
nullable: true
39853997
x-ms-navigationProperty: true
39863998
Tag:
39873999
anyOf:
39884000
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Tags.Tag'
3989-
- nullable: true
4001+
- enum:
4002+
- null
4003+
nullable: true
39904004
x-ms-navigationProperty: true
39914005
example:
39924006
DocumentId: 0
@@ -4186,17 +4200,23 @@ components:
41864200
LibraryParent:
41874201
anyOf:
41884202
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library'
4189-
- nullable: true
4203+
- enum:
4204+
- null
4205+
nullable: true
41904206
x-ms-navigationProperty: true
41914207
Type:
41924208
anyOf:
41934209
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType'
4194-
- nullable: true
4210+
- enum:
4211+
- null
4212+
nullable: true
41954213
x-ms-navigationProperty: true
41964214
SourceFolder:
41974215
anyOf:
41984216
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library'
4199-
- nullable: true
4217+
- enum:
4218+
- null
4219+
nullable: true
42004220
x-ms-navigationProperty: true
42014221
Documents:
42024222
type: array
@@ -4333,12 +4353,16 @@ components:
43334353
MasterLibraryType:
43344354
anyOf:
43354355
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType'
4336-
- nullable: true
4356+
- enum:
4357+
- null
4358+
nullable: true
43374359
x-ms-navigationProperty: true
43384360
ParentLibraryTypes:
43394361
anyOf:
43404362
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType'
4341-
- nullable: true
4363+
- enum:
4364+
- null
4365+
nullable: true
43424366
x-ms-navigationProperty: true
43434367
MasterLibraryTypeChildren:
43444368
type: array
@@ -4725,7 +4749,9 @@ components:
47254749
Document:
47264750
anyOf:
47274751
- $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document'
4728-
- nullable: true
4752+
- enum:
4753+
- null
4754+
nullable: true
47294755
x-ms-navigationProperty: true
47304756
example:
47314757
Id: 0

0 commit comments

Comments
 (0)