Skip to content

Commit e07d790

Browse files
authored
[Azure Maps] Geolocation: swagger improvement for SDK generation [Hub Generated] (#16030)
* Geolocation: Use user-friendly key and filename for x-ms-examples * Geolocation: Use client name ipAddress for parameter ip * Common: Set TextFormat/ResponseFormat default to json * All: Remove operationId prefix for swagger except Creator * Geolocation: Rename method GetIPToLocationPreview to GetLocation * All: Rename [Service]ApiVersion to ApiVersion * Common: Use client name mapsClientId for x-ms-client-id * Remove -Preview suffix * Common: Remove x-ms-parameterized-host/schemes/cosumes * Common: TextFormat->ResponseFormat, ResponseFormat->JsonFormat * Common: Model GeojsonObject as a closed enum * Common: Reset JsonFormat/ResponseFormat modelAsString=true * Common: Rename mapsClientId as clientId
1 parent c9992af commit e07d790

File tree

20 files changed

+266
-274
lines changed

20 files changed

+266
-274
lines changed

specification/maps/data-plane/Common/preview/1.0/common.json

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@
44
"title": "Azure Maps Common Types",
55
"version": "1.0"
66
},
7-
"x-ms-parameterized-host": {
8-
"hostTemplate": "{geography}.atlas.microsoft.com",
9-
"parameters": [
10-
{
11-
"$ref": "#/parameters/GeographicResourceLocation"
12-
}
13-
]
14-
},
15-
"schemes": [
16-
"https"
17-
],
18-
"consumes": [],
197
"produces": [
208
"application/json"
219
],
@@ -203,7 +191,7 @@
203191
],
204192
"x-ms-enum": {
205193
"name": "GeoJsonObjectType",
206-
"modelAsString": true,
194+
"modelAsString": false,
207195
"values": [
208196
{
209197
"value": "Point",
@@ -535,6 +523,7 @@
535523
"parameters": {
536524
"ClientId": {
537525
"name": "x-ms-client-id",
526+
"x-ms-client-name": "clientId",
538527
"description": "Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.",
539528
"type": "string",
540529
"in": "header",
@@ -547,7 +536,7 @@
547536
"type": "string",
548537
"x-ms-parameter-location": "method"
549538
},
550-
"ResponseFormat": {
539+
"JsonFormat": {
551540
"name": "format",
552541
"description": "Desired format of the response. Only `json` format is supported.",
553542
"type": "string",
@@ -557,7 +546,7 @@
557546
"json"
558547
],
559548
"x-ms-enum": {
560-
"name": "ResponseFormat",
549+
"name": "JsonFormat",
561550
"modelAsString": true,
562551
"values": [
563552
{
@@ -566,9 +555,10 @@
566555
}
567556
]
568557
},
558+
"x-ms-client-default": "json",
569559
"x-ms-parameter-location": "method"
570560
},
571-
"TextFormat": {
561+
"ResponseFormat": {
572562
"name": "format",
573563
"description": "Desired format of the response. Value can be either _json_ or _xml_.",
574564
"type": "string",
@@ -579,7 +569,7 @@
579569
"xml"
580570
],
581571
"x-ms-enum": {
582-
"name": "TextFormat",
572+
"name": "ResponseFormat",
583573
"modelAsString": true,
584574
"values": [
585575
{
@@ -592,6 +582,7 @@
592582
}
593583
]
594584
},
585+
"x-ms-client-default": "json",
595586
"x-ms-parameter-location": "method"
596587
},
597588
"GeographicResourceLocation": {

specification/maps/data-plane/Creator/preview/1.0/spatial.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
],
5050
"responses": {},
5151
"parameters": {
52-
"SpatialApiVersion": {
52+
"ApiVersion": {
5353
"name": "api-version",
5454
"description": "Version number of Azure Maps API.",
5555
"type": "string",
@@ -176,10 +176,10 @@
176176
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
177177
},
178178
{
179-
"$ref": "#/parameters/SpatialApiVersion"
179+
"$ref": "#/parameters/ApiVersion"
180180
},
181181
{
182-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
182+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
183183
},
184184
{
185185
"name": "deviceId",
@@ -263,10 +263,10 @@
263263
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
264264
},
265265
{
266-
"$ref": "#/parameters/SpatialApiVersion"
266+
"$ref": "#/parameters/ApiVersion"
267267
},
268268
{
269-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
269+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
270270
},
271271
{
272272
"name": "deviceId",
@@ -348,10 +348,10 @@
348348
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
349349
},
350350
{
351-
"$ref": "#/parameters/SpatialApiVersion"
351+
"$ref": "#/parameters/ApiVersion"
352352
},
353353
{
354-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
354+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
355355
},
356356
{
357357
"name": "bufferRequestBody",
@@ -388,10 +388,10 @@
388388
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
389389
},
390390
{
391-
"$ref": "#/parameters/SpatialApiVersion"
391+
"$ref": "#/parameters/ApiVersion"
392392
},
393393
{
394-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
394+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
395395
},
396396
{
397397
"$ref": "#/parameters/SpatialUploadUdid"
@@ -431,10 +431,10 @@
431431
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
432432
},
433433
{
434-
"$ref": "#/parameters/SpatialApiVersion"
434+
"$ref": "#/parameters/ApiVersion"
435435
},
436436
{
437-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
437+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
438438
},
439439
{
440440
"$ref": "#/parameters/SpatialLatitude"
@@ -477,10 +477,10 @@
477477
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
478478
},
479479
{
480-
"$ref": "#/parameters/SpatialApiVersion"
480+
"$ref": "#/parameters/ApiVersion"
481481
},
482482
{
483-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
483+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
484484
},
485485
{
486486
"$ref": "#/parameters/SpatialUploadUdid"
@@ -525,10 +525,10 @@
525525
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
526526
},
527527
{
528-
"$ref": "#/parameters/SpatialApiVersion"
528+
"$ref": "#/parameters/ApiVersion"
529529
},
530530
{
531-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
531+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
532532
},
533533
{
534534
"$ref": "#/parameters/SpatialLatitude"
@@ -565,10 +565,10 @@
565565
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
566566
},
567567
{
568-
"$ref": "#/parameters/SpatialApiVersion"
568+
"$ref": "#/parameters/ApiVersion"
569569
},
570570
{
571-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
571+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
572572
},
573573
{
574574
"$ref": "#/parameters/SpatialUploadUdid"
@@ -607,10 +607,10 @@
607607
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
608608
},
609609
{
610-
"$ref": "#/parameters/SpatialApiVersion"
610+
"$ref": "#/parameters/ApiVersion"
611611
},
612612
{
613-
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ResponseFormat"
613+
"$ref": "../../../Common/preview/1.0/common.json#/parameters/JsonFormat"
614614
},
615615
{
616616
"name": "query",

specification/maps/data-plane/Creator/preview/2.0/alias.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
],
5050
"responses": {},
5151
"parameters": {
52-
"AliasApiVersionV2": {
52+
"ApiVersion": {
5353
"name": "api-version",
5454
"description": "Version number of Azure Maps API.",
5555
"type": "string",
@@ -97,7 +97,7 @@
9797
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
9898
},
9999
{
100-
"$ref": "#/parameters/AliasApiVersionV2"
100+
"$ref": "#/parameters/ApiVersion"
101101
},
102102
{
103103
"$ref": "#/parameters/CreateCreatorDataItemId"
@@ -134,7 +134,7 @@
134134
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
135135
},
136136
{
137-
"$ref": "#/parameters/AliasApiVersionV2"
137+
"$ref": "#/parameters/ApiVersion"
138138
}
139139
],
140140
"x-ms-pageable": {
@@ -171,7 +171,7 @@
171171
"$ref": "#/parameters/AliasId"
172172
},
173173
{
174-
"$ref": "#/parameters/AliasApiVersionV2"
174+
"$ref": "#/parameters/ApiVersion"
175175
},
176176
{
177177
"$ref": "#/parameters/AssignCreatorDataItemId"
@@ -205,7 +205,7 @@
205205
"$ref": "#/parameters/AliasId"
206206
},
207207
{
208-
"$ref": "#/parameters/AliasApiVersionV2"
208+
"$ref": "#/parameters/ApiVersion"
209209
}
210210
],
211211
"responses": {
@@ -233,7 +233,7 @@
233233
"$ref": "#/parameters/AliasId"
234234
},
235235
{
236-
"$ref": "#/parameters/AliasApiVersionV2"
236+
"$ref": "#/parameters/ApiVersion"
237237
}
238238
],
239239
"responses": {

specification/maps/data-plane/Creator/preview/2.0/data.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
],
5050
"responses": {},
5151
"parameters": {
52-
"DataApiVersionV2": {
52+
"ApiVersion": {
5353
"name": "api-version",
5454
"description": "Version number of Azure Maps API.",
5555
"type": "string",
@@ -139,7 +139,7 @@
139139
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
140140
},
141141
{
142-
"$ref": "#/parameters/DataApiVersionV2"
142+
"$ref": "#/parameters/ApiVersion"
143143
},
144144
{
145145
"$ref": "#/parameters/UploadDataDescription"
@@ -185,7 +185,7 @@
185185
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
186186
},
187187
{
188-
"$ref": "#/parameters/DataApiVersionV2"
188+
"$ref": "#/parameters/ApiVersion"
189189
}
190190
],
191191
"responses": {
@@ -219,7 +219,7 @@
219219
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
220220
},
221221
{
222-
"$ref": "#/parameters/DataApiVersionV2"
222+
"$ref": "#/parameters/ApiVersion"
223223
},
224224
{
225225
"$ref": "#/parameters/UniqueDataId"
@@ -270,7 +270,7 @@
270270
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
271271
},
272272
{
273-
"$ref": "#/parameters/DataApiVersionV2"
273+
"$ref": "#/parameters/ApiVersion"
274274
},
275275
{
276276
"$ref": "#/parameters/UniqueDataId"
@@ -307,7 +307,7 @@
307307
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
308308
},
309309
{
310-
"$ref": "#/parameters/DataApiVersionV2"
310+
"$ref": "#/parameters/ApiVersion"
311311
},
312312
{
313313
"$ref": "#/parameters/UniqueDataId"
@@ -337,7 +337,7 @@
337337
},
338338
"parameters": [
339339
{
340-
"$ref": "#/parameters/DataApiVersionV2"
340+
"$ref": "#/parameters/ApiVersion"
341341
},
342342
{
343343
"$ref": "#/parameters/DataUploadOperationId"

specification/maps/data-plane/Creator/preview/2.0/dataset.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
],
5050
"responses": {},
5151
"parameters": {
52-
"DatasetApiVersionV2": {
52+
"ApiVersion": {
5353
"name": "api-version",
5454
"description": "Version number of Azure Maps API.",
5555
"type": "string",
@@ -117,7 +117,7 @@
117117
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
118118
},
119119
{
120-
"$ref": "#/parameters/DatasetApiVersionV2"
120+
"$ref": "#/parameters/ApiVersion"
121121
},
122122
{
123123
"$ref": "#/parameters/ConversionIdQuery"
@@ -154,7 +154,7 @@
154154
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
155155
},
156156
{
157-
"$ref": "#/parameters/DatasetApiVersionV2"
157+
"$ref": "#/parameters/ApiVersion"
158158
}
159159
],
160160
"x-ms-pageable": {
@@ -191,7 +191,7 @@
191191
"$ref": "#/parameters/DatasetId"
192192
},
193193
{
194-
"$ref": "#/parameters/DatasetApiVersionV2"
194+
"$ref": "#/parameters/ApiVersion"
195195
}
196196
],
197197
"responses": {
@@ -219,7 +219,7 @@
219219
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
220220
},
221221
{
222-
"$ref": "#/parameters/DatasetApiVersionV2"
222+
"$ref": "#/parameters/ApiVersion"
223223
},
224224
{
225225
"$ref": "#/parameters/DatasetId"
@@ -252,7 +252,7 @@
252252
"$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId"
253253
},
254254
{
255-
"$ref": "#/parameters/DatasetApiVersionV2"
255+
"$ref": "#/parameters/ApiVersion"
256256
},
257257
{
258258
"$ref": "#/parameters/DatasetOperationId"

0 commit comments

Comments
 (0)