Skip to content

Commit 7b86188

Browse files
authored
Merge pull request lightspeed-core#387 from tisnik/lcore-433-openapi-metadata
LCORE-433: Support for all OpenAPI metadata
2 parents 0f4476c + 9bbbee8 commit 7b86188

7 files changed

Lines changed: 51 additions & 0 deletions

File tree

docs/openapi.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22
"openapi": "3.1.0",
33
"info": {
44
"title": "Lightspeed Core Service (LCS) service - OpenAPI",
5+
"summary": "Lightspeed Core Service (LCS) service API specification.",
56
"description": "Lightspeed Core Service (LCS) service API specification.",
7+
"contact": {
8+
"name": "Pavel Tisnovsky",
9+
"url": "https://github.com/tisnik/",
10+
"email": "ptisnovs@redhat.com"
11+
},
612
"license": {
713
"name": "Apache 2.0",
814
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
915
},
1016
"version": "0.1.3"
1117
},
18+
"servers": [
19+
{
20+
"url": "http://localhost:8080/",
21+
"description": "Locally running service"
22+
}
23+
],
1224
"paths": {
1325
"/": {
1426
"get": {

docs/openapi.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Lightspeed Core Service (LCS) service API specification.
77

88
| URL | Description |
99
|-----|-------------|
10+
| http://localhost:8080/ | Locally running service |
1011

1112

1213
# 🛠️ APIs

docs/output.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Lightspeed Core Service (LCS) service API specification.
77

88
| URL | Description |
99
|-----|-------------|
10+
| http://localhost:8080/ | Locally running service |
1011

1112

1213
# 🛠️ APIs

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies = [
3535
"authlib>=1.6.0",
3636
"openai==1.99.1",
3737
"sqlalchemy>=2.0.42",
38+
"email-validator>=2.2.0",
3839
]
3940

4041
[tool.pyright]

scripts/generate_openapi_schema.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,14 @@ def read_version_from_pyproject():
6767
# retrieve OpenAPI schema via initialized app
6868
open_api = get_openapi(
6969
title=app.title,
70+
summary=app.summary,
7071
version=app.version,
7172
openapi_version=app.openapi_version,
7273
description=app.description,
7374
routes=app.routes,
7475
license_info=app.license_info,
76+
servers=app.servers,
77+
contact=app.contact,
7578
)
7679

7780
# dump the schema into file

src/app/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@
2323

2424
app = FastAPI(
2525
title=f"{service_name} service - OpenAPI",
26+
summary=f"{service_name} service API specification.",
2627
description=f"{service_name} service API specification.",
2728
version=version.__version__,
29+
contact={
30+
"name": "Pavel Tisnovsky",
31+
"url": "https://github.com/tisnik/",
32+
"email": "ptisnovs@redhat.com",
33+
},
2834
license_info={
2935
"name": "Apache 2.0",
3036
"url": "https://www.apache.org/licenses/LICENSE-2.0.html",
3137
},
38+
servers=[
39+
{"url": "http://localhost:8080/", "description": "Locally running service"}
40+
],
3241
)
3342

3443
app.add_middleware(

uv.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)