Skip to content

Commit d9659dd

Browse files
author
Andrei Neagu
committed
added spec generation
1 parent 441706e commit d9659dd

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

services/notifications/.env-devel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SC_BOOT_MODE=debug
2+
3+
RABBIT_HOST=rabbit
4+
RABBIT_PASSWORD=adminadmin
5+
RABBIT_PORT=5672
6+
RABBIT_SECURE=false
7+
RABBIT_USER=admin
8+
9+
POSTGRES_DB=simcoredb
10+
POSTGRES_ENDPOINT=postgres:5432
11+
POSTGRES_HOST=postgres
12+
POSTGRES_PASSWORD=adminadmin
13+
POSTGRES_PORT=5432
14+
POSTGRES_USER=scu

services/notifications/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,16 @@
33
#
44
include ../../scripts/common.Makefile
55
include ../../scripts/common-service.Makefile
6+
7+
8+
.PHONY: openapi.json
9+
openapi-specs: openapi.json
10+
openapi.json: .env
11+
# generating openapi specs file (need to have the environment set for this)
12+
@set -o allexport; \
13+
source $<; \
14+
set +o allexport; \
15+
python3 -c "import json; from $(APP_PACKAGE_NAME).main import *; print( json.dumps(the_app.openapi(), indent=2) )" > $@
16+
17+
# validates OAS file: $@
18+
$(call validate_openapi_specs,$@)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"openapi": "3.1.0",
3+
"info": {
4+
"title": "simcore-service-notifications",
5+
"description": "Service for executing commands on docker nodes",
6+
"version": "0.0.1"
7+
},
8+
"servers": [
9+
{
10+
"url": "/",
11+
"description": "Default server: requests directed to serving url"
12+
},
13+
{
14+
"url": "http://{host}:{port}",
15+
"description": "Development server: can configure any base url",
16+
"variables": {
17+
"host": {
18+
"default": "127.0.0.1"
19+
},
20+
"port": {
21+
"default": "8000"
22+
}
23+
}
24+
}
25+
],
26+
"paths": {
27+
"/health": {
28+
"get": {
29+
"summary": "Check Service Health",
30+
"operationId": "check_service_health_health_get",
31+
"responses": {
32+
"200": {
33+
"description": "Successful Response",
34+
"content": {
35+
"application/json": {
36+
"schema": {
37+
"$ref": "#/components/schemas/HealthCheckGet"
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}
44+
}
45+
},
46+
"components": {
47+
"schemas": {
48+
"HealthCheckGet": {
49+
"properties": {
50+
"timestamp": {
51+
"type": "string",
52+
"title": "Timestamp"
53+
}
54+
},
55+
"type": "object",
56+
"required": [
57+
"timestamp"
58+
],
59+
"title": "HealthCheckGet",
60+
"example": {
61+
"timestamp": "simcore_service_directorv2.api.routes.health@2023-07-03T12:59:12.024551+00:00"
62+
}
63+
}
64+
}
65+
}
66+
}

0 commit comments

Comments
 (0)