Skip to content

Commit f6f26df

Browse files
edevoogdxuzhg
andauthored
Fix casing of OpenAPI type "String" for RefPatchOperationHandler and RefPostOperationHandler (#78)
* Fix casing from "String" to "string" * Fix tests resources Co-authored-by: Sam Xu <[email protected]>
1 parent f08180c commit f6f26df

File tree

10 files changed

+91
-91
lines changed

10 files changed

+91
-91
lines changed

src/Microsoft.OpenApi.OData.Reader/Operation/RefPatchOperationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected override void SetRequestBody(OpenApiOperation operation)
4040
{
4141
OpenApiSchema schema = new OpenApiSchema
4242
{
43-
Type = "String"
43+
Type = "string"
4444
};
4545

4646
operation.RequestBody = new OpenApiRequestBody

src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected override void SetRequestBody(OpenApiOperation operation)
4040
{
4141
OpenApiSchema schema = new OpenApiSchema
4242
{
43-
Type = "String"
43+
Type = "string"
4444
};
4545

4646
operation.RequestBody = new OpenApiRequestBody
@@ -66,7 +66,7 @@ protected override void SetResponses(OpenApiOperation operation)
6666
{
6767
OpenApiSchema schema = new OpenApiSchema
6868
{
69-
Type = "String" // What to return?
69+
Type = "string" // What to return?
7070
};
7171

7272
operation.Responses = new OpenApiResponses

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -998,15 +998,15 @@
998998
"description": "New navigation property ref value",
999999
"required": true,
10001000
"schema": {
1001-
"type": "String"
1001+
"type": "string"
10021002
}
10031003
}
10041004
],
10051005
"responses": {
10061006
"201": {
10071007
"description": "Created navigation property link.",
10081008
"schema": {
1009-
"type": "String"
1009+
"type": "string"
10101010
}
10111011
},
10121012
"default": {
@@ -1707,15 +1707,15 @@
17071707
"description": "New navigation property ref value",
17081708
"required": true,
17091709
"schema": {
1710-
"type": "String"
1710+
"type": "string"
17111711
}
17121712
}
17131713
],
17141714
"responses": {
17151715
"201": {
17161716
"description": "Created navigation property link.",
17171717
"schema": {
1718-
"type": "String"
1718+
"type": "string"
17191719
}
17201720
},
17211721
"default": {
@@ -2272,7 +2272,7 @@
22722272
"description": "New navigation property ref values",
22732273
"required": true,
22742274
"schema": {
2275-
"type": "String"
2275+
"type": "string"
22762276
}
22772277
}
22782278
],
@@ -3031,15 +3031,15 @@
30313031
"description": "New navigation property ref value",
30323032
"required": true,
30333033
"schema": {
3034-
"type": "String"
3034+
"type": "string"
30353035
}
30363036
}
30373037
],
30383038
"responses": {
30393039
"201": {
30403040
"description": "Created navigation property link.",
30413041
"schema": {
3042-
"type": "String"
3042+
"type": "string"
30433043
}
30443044
},
30453045
"default": {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -720,12 +720,12 @@ paths:
720720
description: New navigation property ref value
721721
required: true
722722
schema:
723-
type: String
723+
type: string
724724
responses:
725725
'201':
726726
description: Created navigation property link.
727727
schema:
728-
type: String
728+
type: string
729729
default:
730730
$ref: '#/responses/error'
731731
x-ms-docs-operation-type: operation
@@ -1231,12 +1231,12 @@ paths:
12311231
description: New navigation property ref value
12321232
required: true
12331233
schema:
1234-
type: String
1234+
type: string
12351235
responses:
12361236
'201':
12371237
description: Created navigation property link.
12381238
schema:
1239-
type: String
1239+
type: string
12401240
default:
12411241
$ref: '#/responses/error'
12421242
x-ms-docs-operation-type: operation
@@ -1654,7 +1654,7 @@ paths:
16541654
description: New navigation property ref values
16551655
required: true
16561656
schema:
1657-
type: String
1657+
type: string
16581658
responses:
16591659
'204':
16601660
description: Success
@@ -2207,12 +2207,12 @@ paths:
22072207
description: New navigation property ref value
22082208
required: true
22092209
schema:
2210-
type: String
2210+
type: string
22112211
responses:
22122212
'201':
22132213
description: Created navigation property link.
22142214
schema:
2215-
type: String
2215+
type: string
22162216
default:
22172217
$ref: '#/responses/error'
22182218
x-ms-docs-operation-type: operation

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@
11201120
"content": {
11211121
"application/json": {
11221122
"schema": {
1123-
"type": "String"
1123+
"type": "string"
11241124
}
11251125
}
11261126
},
@@ -1132,7 +1132,7 @@
11321132
"content": {
11331133
"application/json": {
11341134
"schema": {
1135-
"type": "String"
1135+
"type": "string"
11361136
}
11371137
}
11381138
}
@@ -1927,7 +1927,7 @@
19271927
"content": {
19281928
"application/json": {
19291929
"schema": {
1930-
"type": "String"
1930+
"type": "string"
19311931
}
19321932
}
19331933
},
@@ -1939,7 +1939,7 @@
19391939
"content": {
19401940
"application/json": {
19411941
"schema": {
1942-
"type": "String"
1942+
"type": "string"
19431943
}
19441944
}
19451945
}
@@ -2623,7 +2623,7 @@
26232623
"content": {
26242624
"application/json": {
26252625
"schema": {
2626-
"type": "String"
2626+
"type": "string"
26272627
}
26282628
}
26292629
},
@@ -3477,7 +3477,7 @@
34773477
"content": {
34783478
"application/json": {
34793479
"schema": {
3480-
"type": "String"
3480+
"type": "string"
34813481
}
34823482
}
34833483
},
@@ -3489,7 +3489,7 @@
34893489
"content": {
34903490
"application/json": {
34913491
"schema": {
3492-
"type": "String"
3492+
"type": "string"
34933493
}
34943494
}
34953495
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -798,15 +798,15 @@ paths:
798798
content:
799799
application/json:
800800
schema:
801-
type: String
801+
type: string
802802
required: true
803803
responses:
804804
'201':
805805
description: Created navigation property link.
806806
content:
807807
application/json:
808808
schema:
809-
type: String
809+
type: string
810810
default:
811811
$ref: '#/components/responses/error'
812812
x-ms-docs-operation-type: operation
@@ -1372,15 +1372,15 @@ paths:
13721372
content:
13731373
application/json:
13741374
schema:
1375-
type: String
1375+
type: string
13761376
required: true
13771377
responses:
13781378
'201':
13791379
description: Created navigation property link.
13801380
content:
13811381
application/json:
13821382
schema:
1383-
type: String
1383+
type: string
13841384
default:
13851385
$ref: '#/components/responses/error'
13861386
x-ms-docs-operation-type: operation
@@ -1878,7 +1878,7 @@ paths:
18781878
content:
18791879
application/json:
18801880
schema:
1881-
type: String
1881+
type: string
18821882
required: true
18831883
responses:
18841884
'204':
@@ -2492,15 +2492,15 @@ paths:
24922492
content:
24932493
application/json:
24942494
schema:
2495-
type: String
2495+
type: string
24962496
required: true
24972497
responses:
24982498
'201':
24992499
description: Created navigation property link.
25002500
content:
25012501
application/json:
25022502
schema:
2503-
type: String
2503+
type: string
25042504
default:
25052505
$ref: '#/components/responses/error'
25062506
x-ms-docs-operation-type: operation

0 commit comments

Comments
 (0)