Skip to content

Commit d886ce0

Browse files
authored
Merge pull request #47 from JaredCE/micro-service-openAPI
Micro service open api
2 parents 605ff5e + ddfeb36 commit d886ce0

File tree

3 files changed

+678
-0
lines changed

3 files changed

+678
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"arazzo": "1.0.1",
3+
"info": {
4+
"title": "users",
5+
"description": "The Arazzo Workflow for a Pet Store User",
6+
"summary": "Araazo Workflow for Pet Store User",
7+
"version": "1.0.0"
8+
},
9+
"sourceDescriptions": [
10+
{
11+
"name": "users-openAPI",
12+
"url": "https://raw.githubusercontent.com/JaredCE/Arazzo-Runner/refs/heads/main/test/mocks/openapi/security/api-key/users-openapi.json",
13+
"type": "openapi"
14+
}
15+
],
16+
"workflows": [
17+
{
18+
"workflowId": "LoginUser-apiKey",
19+
"summary": "Deletes the current user",
20+
"description": "Logs the user in and then deletes them",
21+
"inputs": {
22+
"type": "object",
23+
"properties": {
24+
"username": {
25+
"type": "string"
26+
},
27+
"password": {
28+
"type": "string"
29+
}
30+
}
31+
},
32+
"steps": [
33+
{
34+
"stepId": "LoginExistingUser",
35+
"operationId": "loginUser",
36+
"requestBody": {
37+
"contentType": "application/json",
38+
"payload": {
39+
"username": "$inputs.username",
40+
"password": "$inputs.password"
41+
}
42+
},
43+
"outputs": {
44+
"AccessToken": "$response.body#/AccessToken"
45+
}
46+
}
47+
],
48+
"outputs": {
49+
"AccessToken": "$steps.LoginExistingUser.outputs.AccessToken"
50+
}
51+
},
52+
{
53+
"workflowId": "deleteCurrentUser",
54+
"summary": "Deletes the current User",
55+
"description": "Deletes a current user",
56+
"inputs": {
57+
"username": {
58+
"type": "string"
59+
},
60+
"password": {
61+
"type": "string"
62+
}
63+
},
64+
"steps": [
65+
{
66+
"stepId": "LogUserIn",
67+
"workflowId": "LoginUser-apiKey"
68+
},
69+
{
70+
"stepId": "deleteUser",
71+
"operationId": "deleteUser",
72+
"parameters": [
73+
{
74+
"name": "Authorization",
75+
"in": "header",
76+
"value": "$workflows.LoginUser-apiKey.outputs.AccessToken"
77+
},
78+
{
79+
"name": "username",
80+
"in": "path",
81+
"value": "$inputs.username"
82+
}
83+
]
84+
}
85+
]
86+
}
87+
]
88+
}
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"openapi": "3.0.3",
3+
"components": {
4+
"schemas": {
5+
"userLogin": {
6+
"type": "object",
7+
"properties": {
8+
"username": {
9+
"type": "string"
10+
},
11+
"password": {
12+
"type": "string"
13+
}
14+
}
15+
},
16+
"loginResponse": {
17+
"type": "object",
18+
"properties": {
19+
"AccessToken": {
20+
"type": "string"
21+
}
22+
}
23+
},
24+
"x-rate-limit": {
25+
"type": "integer"
26+
},
27+
"X-Expires-After": {
28+
"type": "string"
29+
},
30+
"username": {
31+
"type": "string"
32+
}
33+
},
34+
"securitySchemes": {
35+
"Authorization": {
36+
"type": "apiKey",
37+
"name": "Authorization",
38+
"in": "header"
39+
}
40+
}
41+
},
42+
"info": {
43+
"title": "Petstore User",
44+
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.\n",
45+
"version": "1.0.0",
46+
"termsOfService": "http://swagger.io/terms/",
47+
"contact": {
48+
"name": "",
49+
"email": "apiteam@swagger.io"
50+
},
51+
"license": {
52+
"name": "Apache 2.0",
53+
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
54+
}
55+
},
56+
"security": [
57+
{
58+
"Authorization": []
59+
}
60+
],
61+
"paths": {
62+
"/user/login": {
63+
"post": {
64+
"summary": "Logs user into the system",
65+
"description": "",
66+
"operationId": "loginUser",
67+
"parameters": [],
68+
"tags": [
69+
"user"
70+
],
71+
"requestBody": {
72+
"description": "User Login information",
73+
"required": true,
74+
"content": {
75+
"application/json": {
76+
"schema": {
77+
"$ref": "#/components/schemas/userLogin"
78+
}
79+
}
80+
}
81+
},
82+
"responses": {
83+
"200": {
84+
"description": "successful operation",
85+
"content": {
86+
"application/json": {
87+
"schema": {
88+
"$ref": "#/components/schemas/loginResponse"
89+
}
90+
}
91+
},
92+
"headers": {
93+
"x-rate-limit": {
94+
"description": "calls per hour allowed by the user",
95+
"schema": {
96+
"$ref": "#/components/schemas/x-rate-limit"
97+
}
98+
},
99+
"X-Expires-After": {
100+
"description": "date in UTC when token expires",
101+
"schema": {
102+
"$ref": "#/components/schemas/X-Expires-After"
103+
}
104+
}
105+
}
106+
},
107+
"400": {
108+
"description": "Invalid username/password supplied",
109+
"headers": {}
110+
}
111+
}
112+
}
113+
},
114+
"/user/logout": {
115+
"get": {
116+
"summary": "",
117+
"description": "",
118+
"operationId": "logout",
119+
"parameters": [],
120+
"tags": [
121+
"user"
122+
],
123+
"security": [
124+
{
125+
"Authorization": []
126+
}
127+
],
128+
"responses": {
129+
"200": {
130+
"description": "successful operation",
131+
"headers": {}
132+
}
133+
}
134+
}
135+
}
136+
},
137+
"servers": [
138+
{
139+
"url": "http://petstore.swagger.io/v2"
140+
}
141+
],
142+
"tags": [
143+
{
144+
"name": "user",
145+
"description": "Operations about user",
146+
"externalDocs": {
147+
"description": "Find out more about our store",
148+
"url": "http://swagger.ios"
149+
}
150+
}
151+
],
152+
"externalDocs": {
153+
"description": "Find out more about Swagger",
154+
"url": "http://swagger.io"
155+
}
156+
}

0 commit comments

Comments
 (0)