swagger schema and mocks
This commit is contained in:
parent
2a11d17d80
commit
be0f819b7e
257
openapi.json
Normal file
257
openapi.json
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
{
|
||||||
|
"openapi": "3.0.0",
|
||||||
|
"info": {
|
||||||
|
"title": "Mocks",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
"servers": [
|
||||||
|
{
|
||||||
|
"url": "http://localhost:3001/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"components": {
|
||||||
|
"schemas": {
|
||||||
|
"ValuesRGB": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"red": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"green": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"blue": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"red",
|
||||||
|
"green",
|
||||||
|
"blue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"/sensval": {
|
||||||
|
"get": {
|
||||||
|
"description": "",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"LED1": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"LED2": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"LED3": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"button1State": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"button2State": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"button3State": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"temperature": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "float"
|
||||||
|
},
|
||||||
|
"pressure": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "float"
|
||||||
|
},
|
||||||
|
"ambient_light": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"red_light": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"green_light": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"blue_light": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"lightness": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"acceleration_x": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "float"
|
||||||
|
},
|
||||||
|
"acceleration_y": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "float"
|
||||||
|
},
|
||||||
|
"acceleration_z": {
|
||||||
|
"type": "number",
|
||||||
|
"format": "float"
|
||||||
|
},
|
||||||
|
"leds1": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds2": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds3": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds4": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds5": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds6": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds7": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds8": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"example": {
|
||||||
|
"LED1": false,
|
||||||
|
"LED2": true,
|
||||||
|
"LED3": false,
|
||||||
|
"button1State": true,
|
||||||
|
"button2State": false,
|
||||||
|
"button3State": true,
|
||||||
|
"temperature": 25,
|
||||||
|
"pressure": 100,
|
||||||
|
"ambient_light": 100,
|
||||||
|
"red_light": 200,
|
||||||
|
"green_light": 300,
|
||||||
|
"blue_light": 400,
|
||||||
|
"lightness": 500,
|
||||||
|
"acceleration_x": 0.1,
|
||||||
|
"acceleration_y": 0.2,
|
||||||
|
"acceleration_z": 0.3,
|
||||||
|
"leds1": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
},
|
||||||
|
"leds2": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
},
|
||||||
|
"leds3": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
},
|
||||||
|
"leds4": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
},
|
||||||
|
"leds5": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
},
|
||||||
|
"leds6": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
},
|
||||||
|
"leds7": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
},
|
||||||
|
"leds8": {
|
||||||
|
"red": 100,
|
||||||
|
"green": 150,
|
||||||
|
"blue": 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"headers": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/postvalue": {
|
||||||
|
"post": {
|
||||||
|
"description": "",
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"LED1": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"LED2": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"LED3": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"leds1": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds2": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds3": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds4": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds5": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds6": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds7": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
},
|
||||||
|
"leds8": {
|
||||||
|
"$ref": "#/components/schemas/ValuesRGB"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"text/plain": {
|
||||||
|
"example": "POST body was:\n{ }"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"headers": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
115
openapi_mock.json
Normal file
115
openapi_mock.json
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
{
|
||||||
|
"uuid": "5ea1e52b-5df9-4503-ab2c-6513fdc53d16",
|
||||||
|
"lastMigration": 27,
|
||||||
|
"name": "Mocks",
|
||||||
|
"endpointPrefix": "",
|
||||||
|
"latency": 0,
|
||||||
|
"port": 3001,
|
||||||
|
"hostname": "",
|
||||||
|
"folders": [],
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"uuid": "ea43e328-6bbc-43ba-a12a-de222a28fd8b",
|
||||||
|
"type": "http",
|
||||||
|
"documentation": "",
|
||||||
|
"method": "get",
|
||||||
|
"endpoint": "sensval",
|
||||||
|
"responses": [
|
||||||
|
{
|
||||||
|
"uuid": "cead61d4-7745-455c-a3a9-cb8854cefcc2",
|
||||||
|
"body": "{\n \"LED1\": false,\n \"LED2\": true,\n \"LED3\": false,\n \"button1State\": true,\n \"button2State\": false,\n \"button3State\": true,\n \"temperature\": 25,\n \"pressure\": 100,\n \"ambient_light\": 100,\n \"red_light\": 200,\n \"green_light\": 300,\n \"blue_light\": 400,\n \"lightness\": 500,\n \"acceleration_x\": 0.1,\n \"acceleration_y\": 0.2,\n \"acceleration_z\": 0.3,\n \"leds1\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n },\n \"leds2\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n },\n \"leds3\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n },\n \"leds4\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n },\n \"leds5\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n },\n \"leds6\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n },\n \"leds7\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n },\n \"leds8\": {\n \"red\": 100,\n \"green\": 150,\n \"blue\": 200\n }\n}",
|
||||||
|
"latency": 0,
|
||||||
|
"statusCode": 200,
|
||||||
|
"label": "",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bodyType": "INLINE",
|
||||||
|
"filePath": "",
|
||||||
|
"databucketID": "",
|
||||||
|
"sendFileAsBody": false,
|
||||||
|
"rules": [],
|
||||||
|
"rulesOperator": "OR",
|
||||||
|
"disableTemplating": false,
|
||||||
|
"fallbackTo404": false,
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enabled": true,
|
||||||
|
"responseMode": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "166a5c8a-d866-4e93-91c6-c9cf21fbbf04",
|
||||||
|
"type": "http",
|
||||||
|
"documentation": "",
|
||||||
|
"method": "post",
|
||||||
|
"endpoint": "postvalue",
|
||||||
|
"responses": [
|
||||||
|
{
|
||||||
|
"uuid": "a7ae227a-8ca7-49bc-8577-d30af6ee16e9",
|
||||||
|
"body": "POST body was:\n{{body}}",
|
||||||
|
"latency": 0,
|
||||||
|
"statusCode": 200,
|
||||||
|
"label": "",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "text/plain"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bodyType": "INLINE",
|
||||||
|
"filePath": "",
|
||||||
|
"databucketID": "",
|
||||||
|
"sendFileAsBody": false,
|
||||||
|
"rules": [],
|
||||||
|
"rulesOperator": "OR",
|
||||||
|
"disableTemplating": false,
|
||||||
|
"fallbackTo404": false,
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enabled": true,
|
||||||
|
"responseMode": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rootChildren": [
|
||||||
|
{
|
||||||
|
"type": "route",
|
||||||
|
"uuid": "ea43e328-6bbc-43ba-a12a-de222a28fd8b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "route",
|
||||||
|
"uuid": "166a5c8a-d866-4e93-91c6-c9cf21fbbf04"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"proxyMode": false,
|
||||||
|
"proxyHost": "",
|
||||||
|
"proxyRemovePrefix": false,
|
||||||
|
"tlsOptions": {
|
||||||
|
"enabled": false,
|
||||||
|
"type": "CERT",
|
||||||
|
"pfxPath": "",
|
||||||
|
"certPath": "",
|
||||||
|
"keyPath": "",
|
||||||
|
"caPath": "",
|
||||||
|
"passphrase": ""
|
||||||
|
},
|
||||||
|
"cors": true,
|
||||||
|
"headers": [],
|
||||||
|
"proxyReqHeaders": [
|
||||||
|
{
|
||||||
|
"key": "",
|
||||||
|
"value": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"proxyResHeaders": [
|
||||||
|
{
|
||||||
|
"key": "",
|
||||||
|
"value": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"data": []
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user