Skip to content

Commit c268c73

Browse files
authored
[Schema Registry] Update swagger (Azure#16738)
* [Schema Registry] Remove 415 response * add 415 back with a schema * address feedback * no need to update the default case * add x-ms-error-code headers back because the guidelines require them * update the patterns * factor schema name parameter into one definition * add an example for 415 * update examples
1 parent 9e8a591 commit c268c73

File tree

3 files changed

+57
-25
lines changed

3 files changed

+57
-25
lines changed

specification/schemaregistry/data-plane/Microsoft.EventHub/stable/2021-10/examples/OperationSchema_QueryIdByContent.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
"Schema-Version": 3
1818
}
1919
},
20-
"415": {}
20+
"415": {
21+
"headers": {
22+
"x-ms-error-code": "InvalidSchemaType"
23+
},
24+
"body": {
25+
"error": {
26+
"code": "InvalidSchemaType",
27+
"message": "Invalid schema type for POST request. 'not-valid' is not supported. TrackingId:7fe9dcfb-0fca-4ab2-9beb-473aa5fe6406_G23, SystemTracker:endpoint:$schemaGroups/sample-sr-group/schemas/sample-schema-name:get-id, Timestamp:2021-11-10T07:53:32"
28+
}
29+
}
30+
}
2131
}
2232
}

specification/schemaregistry/data-plane/Microsoft.EventHub/stable/2021-10/examples/OperationSchema_Register.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
"Schema-Version": 3
1818
}
1919
},
20-
"415": {}
20+
"415": {
21+
"headers": {
22+
"x-ms-error-code": "InvalidSchemaType"
23+
},
24+
"body": {
25+
"error": {
26+
"code": "InvalidSchemaType",
27+
"message": "Invalid schema type for PUT request. 'not-valid' is not supported. TrackingId:a20c52d6-9818-4748-b91a-aad9ca35212e_G23, SystemTracker:endpoint:$schemaGroups/sample-sr-group/schemas/sample-schema-name, Timestamp:2021-11-10T07:53:30"
28+
}
29+
}
30+
}
2131
}
2232
}

specification/schemaregistry/data-plane/Microsoft.EventHub/stable/2021-10/schemaregistry.json

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,7 @@
169169
"type": "string"
170170
},
171171
{
172-
"name": "schemaName",
173-
"in": "path",
174-
"description": "Name of schema being registered.",
175-
"required": true,
176-
"type": "string",
177-
"maxLength": 50,
178-
"pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$"
172+
"$ref": "#/parameters/SchemaName"
179173
},
180174
{
181175
"$ref": "#/parameters/ApiVersionParameter"
@@ -228,13 +222,7 @@
228222
"type": "string"
229223
},
230224
{
231-
"name": "schemaName",
232-
"in": "path",
233-
"description": "Name of requested schema.",
234-
"required": true,
235-
"type": "string",
236-
"maxLength": 50,
237-
"pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$"
225+
"$ref": "#/parameters/SchemaName"
238226
},
239227
{
240228
"name": "schemaContent",
@@ -281,7 +269,17 @@
281269
}
282270
},
283271
"415": {
284-
"description": "Unsupported Media Type - Content type of the supplied schema is unsupported by schema group."
272+
"description": "Unsupported Media Type - Content type of the supplied schema is unsupported by schema group.",
273+
"headers": {
274+
"x-ms-error-code": {
275+
"type": "string",
276+
"description": "Error code for specific error that occurred."
277+
}
278+
},
279+
"schema": {
280+
"$ref": "#/definitions/Error"
281+
},
282+
"x-ms-error-response": true
285283
},
286284
"default": {
287285
"description": "An error response received from the Azure Schema Registry service.",
@@ -323,13 +321,7 @@
323321
"type": "string"
324322
},
325323
{
326-
"name": "schemaName",
327-
"in": "path",
328-
"description": "Name of schema being registered.",
329-
"required": true,
330-
"type": "string",
331-
"maxLength": 50,
332-
"pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$"
324+
"$ref": "#/parameters/SchemaName"
333325
},
334326
{
335327
"name": "schemaContent",
@@ -376,7 +368,17 @@
376368
}
377369
},
378370
"415": {
379-
"description": "Unsupported Media Type - Content type of the supplied schema is unsupported by schema group."
371+
"description": "Unsupported Media Type - Content type of the supplied schema is unsupported by schema group.",
372+
"headers": {
373+
"x-ms-error-code": {
374+
"type": "string",
375+
"description": "Error code for specific error that occurred."
376+
}
377+
},
378+
"schema": {
379+
"$ref": "#/definitions/Error"
380+
},
381+
"x-ms-error-response": true
380382
},
381383
"default": {
382384
"description": "An error response received from the Azure Schema Registry service.",
@@ -492,6 +494,16 @@
492494
"in": "path",
493495
"x-ms-skip-url-encoding": true,
494496
"x-ms-parameter-location": "client"
497+
},
498+
"SchemaName": {
499+
"name": "schemaName",
500+
"in": "path",
501+
"description": "Name of schema.",
502+
"required": true,
503+
"type": "string",
504+
"maxLength": 50,
505+
"pattern": "^[A-Za-z0-9][^\\\\/$:]*$",
506+
"x-ms-parameter-location": "method"
495507
}
496508
}
497509
}

0 commit comments

Comments
 (0)