File: openapi_extensions.py

package info (click to toggle)
flask-openapi3 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,224 kB
  • sloc: python: 4,802; makefile: 14; javascript: 5
file content (25 lines) | stat: -rw-r--r-- 581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
# @Author  : llc
# @Time    : 2023/5/31 14:24
from flask_openapi3 import OpenAPI

app = OpenAPI(
    __name__,
    openapi_extensions={
        "x-google-endpoints": [{"name": "my-cool-api.endpoints.my-project-id.cloud.goog", "allowCors": True}]
    },
)

openapi_extensions = {
    "x-google-backend": {"address": "https://<NODE_SERVICE_ID>-<HASH>.a.run.app", "protocol": "h2"},
    "x-aperture-labs-portal": "blue",
}


@app.get("/", openapi_extensions=openapi_extensions)
def hello():
    return "ok"


if __name__ == "__main__":
    app.run(debug=True)