-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chg: [api] Added contact and license informations to the OpenAPI metada.
- Loading branch information
1 parent
daf0615
commit 9f2b0ba
Showing
1 changed file
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from typing import Any | ||
from typing import Dict | ||
from typing import List | ||
|
||
from fastapi import Depends | ||
|
@@ -15,14 +17,24 @@ | |
app = FastAPI() | ||
|
||
|
||
def custom_openapi(): | ||
def custom_openapi() -> Dict[str, Any]: | ||
if app.openapi_schema: | ||
return app.openapi_schema | ||
openapi_schema = get_openapi( | ||
title="SCANDALE - Pumpkin", | ||
version="0.1.0", | ||
summary="API of the Pumpkin project.", | ||
description="Backend API for collecting data from probes and storing proof of checks from various scans.", | ||
contact={ | ||
"name": "Computer Incident Response Center Luxembourg", | ||
"url": "https://www.circl.lu", | ||
"email": "[email protected]", | ||
}, | ||
license_info={ | ||
"name": "GNU Affero General Public License v3.0 or later", | ||
"identifier": "AGPL-3.0-or-later", | ||
"url": "https://www.gnu.org/licenses/agpl-3.0.en.html", | ||
}, | ||
routes=app.routes, | ||
) | ||
openapi_schema["info"]["x-logo"] = { | ||
|