Skip to content

Commit 0c095af

Browse files
akning-ms00Kai0
authored andcommitted
Dev todo microsoft.sample rp 2020 05 01 (Azure#9513)
* New Readme Config File * New Go Language Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New Ruby Language Readme Config File * New Swagger Spec File * New Swagger Example Spec File * add new swagger.json
1 parent f370ec8 commit 0c095af

File tree

9 files changed

+524
-0
lines changed

9 files changed

+524
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"parameters": {
3+
"accountName": "sampleacct",
4+
"resourceGroupName": "todoClient",
5+
"api-version": "2020-05-01",
6+
"subscriptionId": "subid"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"sampleProperty": "sampleProperty"
12+
}
13+
}
14+
}
15+
}
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
{
2+
"openapi": "3.0.1",
3+
"info": {
4+
"title": "ToDo API",
5+
"description": "A simple example ASP.NET Core Web API",
6+
"termsOfService": "https://example.com/terms",
7+
"contact": {
8+
"name": "Shayne Boyer",
9+
"url": "https://twitter.com/spboyer",
10+
"email": ""
11+
},
12+
"license": {
13+
"name": "Use under LICX",
14+
"url": "https://example.com/license"
15+
},
16+
"version": "v1"
17+
},
18+
"paths": {
19+
"/api/Todo": {
20+
"get": {
21+
"tags": [
22+
"Todo"
23+
],
24+
"responses": {
25+
"200": {
26+
"description": "Success",
27+
"content": {
28+
"application/json": {
29+
"schema": {
30+
"type": "array",
31+
"items": {
32+
"$ref": "#/components/schemas/TodoItem"
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}
39+
},
40+
"post": {
41+
"tags": [
42+
"Todo"
43+
],
44+
"summary": "Creates a TodoItem.",
45+
"description": "Sample request:\r\n \r\n POST /Todo\r\n {\r\n \"id\": 1,\r\n \"name\": \"Item1\",\r\n \"isComplete\": true\r\n }",
46+
"requestBody": {
47+
"content": {
48+
"application/json-patch+json": {
49+
"schema": {
50+
"$ref": "#/components/schemas/TodoItem"
51+
}
52+
},
53+
"application/json": {
54+
"schema": {
55+
"$ref": "#/components/schemas/TodoItem"
56+
}
57+
},
58+
"text/json": {
59+
"schema": {
60+
"$ref": "#/components/schemas/TodoItem"
61+
}
62+
},
63+
"application/*+json": {
64+
"schema": {
65+
"$ref": "#/components/schemas/TodoItem"
66+
}
67+
}
68+
}
69+
},
70+
"responses": {
71+
"201": {
72+
"description": "Returns the newly created item",
73+
"content": {
74+
"application/json": {
75+
"schema": {
76+
"$ref": "#/components/schemas/TodoItem"
77+
}
78+
}
79+
}
80+
},
81+
"400": {
82+
"description": "If the item is null"
83+
}
84+
}
85+
}
86+
},
87+
"/api/Todo/{id}": {
88+
"get": {
89+
"tags": [
90+
"Todo"
91+
],
92+
"operationId": "GetTodo",
93+
"parameters": [
94+
{
95+
"name": "id",
96+
"in": "path",
97+
"required": true,
98+
"schema": {
99+
"type": "integer",
100+
"format": "int64"
101+
}
102+
}
103+
],
104+
"responses": {
105+
"200": {
106+
"description": "Success",
107+
"content": {
108+
"application/json": {
109+
"schema": {
110+
"$ref": "#/components/schemas/TodoItem"
111+
}
112+
}
113+
}
114+
}
115+
}
116+
},
117+
"put": {
118+
"tags": [
119+
"Todo"
120+
],
121+
"parameters": [
122+
{
123+
"name": "id",
124+
"in": "path",
125+
"required": true,
126+
"schema": {
127+
"type": "integer",
128+
"format": "int64"
129+
}
130+
}
131+
],
132+
"requestBody": {
133+
"content": {
134+
"application/json-patch+json": {
135+
"schema": {
136+
"$ref": "#/components/schemas/TodoItem"
137+
}
138+
},
139+
"application/json": {
140+
"schema": {
141+
"$ref": "#/components/schemas/TodoItem"
142+
}
143+
},
144+
"text/json": {
145+
"schema": {
146+
"$ref": "#/components/schemas/TodoItem"
147+
}
148+
},
149+
"application/*+json": {
150+
"schema": {
151+
"$ref": "#/components/schemas/TodoItem"
152+
}
153+
}
154+
}
155+
},
156+
"responses": {
157+
"200": {
158+
"description": "Success"
159+
}
160+
}
161+
},
162+
"delete": {
163+
"tags": [
164+
"Todo"
165+
],
166+
"summary": "Deletes a specific TodoItem.",
167+
"parameters": [
168+
{
169+
"name": "id",
170+
"in": "path",
171+
"description": "",
172+
"required": true,
173+
"schema": {
174+
"type": "integer",
175+
"format": "int64"
176+
}
177+
}
178+
],
179+
"responses": {
180+
"200": {
181+
"description": "Success"
182+
}
183+
}
184+
}
185+
}
186+
},
187+
"components": {
188+
"schemas": {
189+
"TodoItem": {
190+
"required": [
191+
"name"
192+
],
193+
"type": "object",
194+
"properties": {
195+
"id": {
196+
"type": "integer",
197+
"format": "int64"
198+
},
199+
"name": {
200+
"type": "string"
201+
},
202+
"isComplete": {
203+
"type": "boolean",
204+
"default": false
205+
}
206+
},
207+
"additionalProperties": false
208+
}
209+
}
210+
}
211+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"version": "2020-05-01",
5+
"title": "todo",
6+
"description": "Description of the new service",
7+
"x-ms-code-generation-settings": {
8+
"name": "todoClient"
9+
}
10+
},
11+
"host": "management.azure.com",
12+
"schemes": ["https"],
13+
"consumes": ["application/json"],
14+
"produces": ["application/json"],
15+
"security": [
16+
{
17+
"azure_auth": ["user_impersonation"]
18+
}
19+
],
20+
"securityDefinitions": {
21+
"azure_auth": {
22+
"type": "oauth2",
23+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
24+
"flow": "implicit",
25+
"description": "Azure Active Directory OAuth2 Flow",
26+
"scopes": {
27+
"user_impersonation": "impersonate your user account"
28+
}
29+
}
30+
},
31+
"paths": {
32+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SampleRP/operations": {
33+
"get": {
34+
"tags": ["Tag1"],
35+
"operationId": "OperationGroup_Get",
36+
"x-ms-examples": {
37+
"BatchAccountDelete": { "$ref": "./examples/OperationGroupGet.json" }
38+
},
39+
"description": "This is a sample get operation, please see guidelines in azure-rest-api-specs repository for more info",
40+
"parameters": [
41+
{
42+
"$ref": "#/parameters/SubscriptionIdParameter"
43+
},
44+
{
45+
"$ref": "#/parameters/ResourceGroupNameParameter"
46+
}
47+
],
48+
"responses": {
49+
"200": {
50+
"description": "Describe the result of a successful operation.",
51+
"schema": {
52+
"$ref": "#/definitions/Result"
53+
}
54+
},
55+
"default": {
56+
"description": "Error response describing why the operation failed.",
57+
"schema": {
58+
"$ref": "#/definitions/ErrorResponse"
59+
}
60+
}
61+
}
62+
}
63+
}
64+
},
65+
"definitions": {
66+
"Result": {
67+
"description": "Sample result definition",
68+
"properties": {
69+
"sampleProperty": {
70+
"type": "string",
71+
"description": "Sample property of type string"
72+
}
73+
}
74+
},
75+
"ErrorResponse": {
76+
"description": "Error response.",
77+
"properties": {
78+
"error": {
79+
"$ref": "#/definitions/ErrorDefinition",
80+
"description": "The error details."
81+
}
82+
}
83+
},
84+
"ErrorDefinition": {
85+
"description": "Error definition.",
86+
"properties": {
87+
"code": {
88+
"description": "Service specific error code which serves as the substatus for the HTTP error code.",
89+
"type": "string",
90+
"readOnly": true
91+
},
92+
"message": {
93+
"description": "Description of the error.",
94+
"type": "string",
95+
"readOnly": true
96+
},
97+
"details": {
98+
"description": "Internal error details.",
99+
"type": "array",
100+
"items": {
101+
"$ref": "#/definitions/ErrorDefinition"
102+
},
103+
"readOnly": true
104+
}
105+
}
106+
}
107+
},
108+
"parameters": {
109+
"SubscriptionIdParameter": {
110+
"name": "subscriptionId",
111+
"in": "path",
112+
"required": true,
113+
"type": "string",
114+
"description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"
115+
},
116+
"ResourceGroupNameParameter": {
117+
"name": "resourceGroupName",
118+
"in": "path",
119+
"required": true,
120+
"type": "string",
121+
"description": "The name of the resource group.",
122+
"x-ms-parameter-location": "method"
123+
},
124+
"ApiVersionParameter": {
125+
"name": "api-version",
126+
"in": "query",
127+
"required": true,
128+
"type": "string",
129+
"description": "The API version to be used with the HTTP request."
130+
}
131+
}
132+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## C
2+
3+
These settings apply only when `--csharp` is specified on the command line.
4+
Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`.
5+
6+
```yaml $(csharp)
7+
csharp:
8+
azure-arm: true
9+
license-header: MICROSOFT_MIT_NO_VERSION
10+
payload-flattening-threshold: 1
11+
clear-output-folder: true
12+
client-side-validation: false
13+
namespace: Microsoft.SampleRP
14+
output-folder: $(csharp-sdks-folder)/todo/management/Microsoft.SampleRP/GeneratedProtocol
15+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Go
2+
3+
These settings apply only when `--go` is specified on the command line.
4+
5+
```yaml $(go)
6+
go:
7+
license-header: MICROSOFT_APACHE_NO_VERSION
8+
clear-output-folder: true
9+
```
10+
11+
### Tag: package-2020-05-01 and go
12+
13+
These settings apply only when `--tag=package-2020-05-01 --go` is specified on the command line.
14+
Please also specify `--go-sdks-folder=<path to the root directory of your azure-sdk-for-go clone>`.
15+
16+
```yaml $(tag) == 'package-2020-05-01' && $(go)
17+
namespace: Microsoft.SampleRP
18+
output-folder: $(go-sdks-folder)/todo/Generated
19+
```

0 commit comments

Comments
 (0)