Skip to content

Commit 3ef03f2

Browse files
authored
Swagger for Mixed Reality STS Service APIs (#11389)
* Swagger for Mixed Reality Sts Service APIs * Ran Prettier tool locally. * API board review feedback: - Changed type and descriptions of cV headers. - Added api version query parameter. - Camel cased x-ms-client-name values. - Added different response types. * Added readme file * Rename swagger file and reference it in the readme * Add x-ms-example * Correct path of x-ms-example * Run prettier + remove body response type from GetToken.json * Add suppression to README.md
1 parent e10bc62 commit 3ef03f2

File tree

3 files changed

+227
-0
lines changed

3 files changed

+227
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parameters": {
3+
"accountId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
4+
"api-version": "2019-02-28-preview",
5+
"X-MRC-CV": ""
6+
},
7+
"responses": {
8+
"200": {
9+
"headers": {
10+
"MS-CV": "dKEFmka2kkSlDmp/af+sOw"
11+
},
12+
"body": {
13+
"AccessToken": "******"
14+
}
15+
},
16+
"400": {
17+
"headers": {
18+
"MS-CV": "dKEFmka2kkSlDmp/af+sOw",
19+
"WWW-Authenticate": "Invalid request: errorMessage"
20+
}
21+
},
22+
"401": {
23+
"headers": {
24+
"MS-CV": "dKEFmka2kkSlDmp/af+sOw",
25+
"WWW-Authenticate": "Invalid token: errorMessage"
26+
}
27+
},
28+
"429": {
29+
"headers": {
30+
"MS-CV": "dKEFmka2kkSlDmp/af+sOw",
31+
"Retry-After": "5"
32+
}
33+
}
34+
}
35+
}
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "MixedRealityStsClient",
5+
"description": "Definition for the Mixed Reality Cloud STS service APIs.",
6+
"version": "2019-02-28-preview"
7+
},
8+
"host": "sts.mixedreality.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"paths": {
13+
"/Accounts/{accountId}/token": {
14+
"get": {
15+
"tags": [
16+
"Accounts"
17+
],
18+
"summary": "Gets an access token to be used with Mixed Reality services.",
19+
"operationId": "GetToken",
20+
"produces": [
21+
"application/json"
22+
],
23+
"x-ms-examples": {
24+
"TokenGet": {
25+
"$ref": "../../examples/GetToken.json"
26+
}
27+
},
28+
"parameters": [
29+
{
30+
"in": "path",
31+
"name": "accountId",
32+
"description": "The Mixed Reality account identifier.",
33+
"required": true,
34+
"type": "string"
35+
},
36+
{
37+
"name": "X-MRC-CV",
38+
"x-ms-client-name": "clientRequestId",
39+
"in": "header",
40+
"description": "The client request correlation vector, which should be set to a new value for each request. Useful when debugging with Microsoft.",
41+
"type": "string",
42+
"x-ms-parameter-grouping": {
43+
"name": "token-request-options"
44+
}
45+
},
46+
{
47+
"in": "query",
48+
"name": "api-version",
49+
"description": "The API version.",
50+
"type": "string"
51+
}
52+
],
53+
"responses": {
54+
"200": {
55+
"description": "Success",
56+
"schema": {
57+
"$ref": "#/definitions/StsTokenResponseMessage"
58+
},
59+
"headers": {
60+
"MS-CV": {
61+
"x-ms-client-name": "requestId",
62+
"description": "The service response correlation vector, which will be a new value for every response. Useful when debugging with Microsoft.",
63+
"type": "string"
64+
}
65+
}
66+
},
67+
"400": {
68+
"description": "Bad request",
69+
"headers": {
70+
"MS-CV": {
71+
"x-ms-client-name": "requestId",
72+
"description": "The service response correlation vector, which will be a new value for every response. Useful when debugging with Microsoft.",
73+
"type": "string"
74+
},
75+
"WWW-Authenticate": {
76+
"description": "Describes the error encountered while trying to authenticate the resource.",
77+
"type": "string"
78+
}
79+
},
80+
"x-ms-error-response": true
81+
},
82+
"401": {
83+
"description": "Unauthorized",
84+
"headers": {
85+
"MS-CV": {
86+
"x-ms-client-name": "requestId",
87+
"description": "The service response correlation vector, which will be a new value for every response. Useful when debugging with Microsoft.",
88+
"type": "string"
89+
},
90+
"WWW-Authenticate": {
91+
"description": "Describes the error encountered while trying to authenticate the resource.",
92+
"type": "string"
93+
}
94+
},
95+
"x-ms-error-response": true
96+
},
97+
"429": {
98+
"description": "Too many requests",
99+
"headers": {
100+
"MS-CV": {
101+
"x-ms-client-name": "requestId",
102+
"description": "The service response correlation vector, which will be a new value for every response. Useful when debugging with Microsoft.",
103+
"type": "string"
104+
},
105+
"WWW-Authenticate": {
106+
"description": "Describes the error encountered while trying to authenticate the resource.",
107+
"type": "string"
108+
}
109+
},
110+
"x-ms-error-response": true
111+
},
112+
"default": {
113+
"description": "Error",
114+
"headers": {
115+
"MS-CV": {
116+
"x-ms-client-name": "requestId",
117+
"description": "The service response correlation vector, which will be a new value for every response. Useful when debugging with Microsoft.",
118+
"type": "string"
119+
}
120+
},
121+
"x-ms-error-response": true
122+
}
123+
}
124+
}
125+
}
126+
},
127+
"definitions": {
128+
"StsTokenResponseMessage": {
129+
"description": "Represents a token response message from the STS service.",
130+
"required": [
131+
"AccessToken"
132+
],
133+
"type": "object",
134+
"properties": {
135+
"AccessToken": {
136+
"description": "An access token for the account.",
137+
"type": "string"
138+
}
139+
}
140+
}
141+
}
142+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Mixed Reality
2+
3+
> see https://aka.ms/autorest
4+
5+
This is the AutoRest configuration file for Mixed Reality.
6+
7+
## Getting Started
8+
9+
To build the SDKs for this API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run:
10+
11+
> `autorest readme.md`
12+
13+
To see additional help and options, run:
14+
15+
> `autorest --help`
16+
17+
For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page.
18+
19+
---
20+
21+
## Configuration
22+
23+
## Suppression
24+
25+
``` yaml
26+
directive:
27+
- suppress: R3016
28+
from: mr-sts.json
29+
where: $.definitions.StsTokenResponseMessage.properties.AccessToken
30+
reason: The API is already public and changing the casing will involve a breaking change.
31+
```
32+
33+
### Basic Information
34+
35+
These are the global settings for Azure Mixed Reality STS.
36+
37+
```yaml
38+
title: MixedRealityStsClient
39+
openapi-type: data-plane
40+
tag: package-2019-02-28-preview
41+
```
42+
43+
### Tag: package-2019-02-28-preview
44+
45+
These settings apply only when `--tag=package-2019-02-28-preview` is specified on the command line.
46+
47+
``` yaml $(tag) == 'package-2019-02-28-preview'
48+
input-file:
49+
- Microsoft.MixedReality/preview/2019-02-28-preview/mr-sts.json
50+
```

0 commit comments

Comments
 (0)