diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 16e2c9cb21c..5662f87d631 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -46,6 +46,9 @@ src/schemas/json/cargo.json @ya7010 src/schemas/json/tombi.json @ya7010 src/schemas/json/pyproject.json @ya7010 +# Managed by FastAPI Team: +src/schemas/json/partial-fastapi.json @tiangolo + # Managed by Contextive Team: src/schemas/json/contextive-glossary.json @chrissimon-au src/test/contextive-glossary/ @chrissimon-au diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index d9d181f07c0..67733e2af65 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -1195,6 +1195,12 @@ "fileMatch": [], "url": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/partial-black.json" }, + { + "name": "partial-fastapi.json", + "description": "FastAPI web framework configuration for pyproject.toml", + "fileMatch": [], + "url": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/partial-fastapi.json" + }, { "name": "bozr.suite.json", "description": "Bozr test suite file", diff --git a/src/schema-validation.jsonc b/src/schema-validation.jsonc index 8b4f7fd575b..3f88b0f33ea 100644 --- a/src/schema-validation.jsonc +++ b/src/schema-validation.jsonc @@ -331,6 +331,7 @@ "partial-setuptools-scm.json", // pyproject.json[tool.setuptools-scm] "partial-scikit-build.json", // pyproject.json[tool.scikit-build] "partial-cibuildwheel.json", // pyproject.json[tool.cibuildwheel] + "partial-fastapi.json", // pyproject.json[tool.fastapi] "partial-mypy.json", // pyproject.json[tool.mypy] "partial-pdm.json", // pyproject.json[tool.pdm] "partial-pdm-dockerize.json", // pyproject.json[tool.pdm.dockerize] @@ -1269,6 +1270,7 @@ "maturin.json", "partial-black.json", "partial-cibuildwheel.json", + "partial-fastapi.json", "partial-mypy.json", "partial-pdm.json", "partial-pdm-dockerize.json", diff --git a/src/schemas/json/partial-fastapi.json b/src/schemas/json/partial-fastapi.json new file mode 100644 index 00000000000..18c0c9231f8 --- /dev/null +++ b/src/schemas/json/partial-fastapi.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/partial-fastapi.json", + "type": "object", + "properties": { + "entrypoint": { + "type": "string", + "title": "Application Entrypoint", + "description": "Import string entrypoint for the **FastAPI** application, in the format: \n```\nimportable.module:attribute\n```\n\nFor example, for an app like:\n\n ```python\nfrom fastapi import FastAPI\n\napp = FastAPI()\n```\n\nin a file at `backend/main.py`\n the config could look like:\n\n```toml\n[tool.fastapi]\nentrypoint = \"backend.main:app\"\n```\n\nDocs: https://fastapi.tiangolo.com/fastapi-cli/", + "examples": ["main:app", "backend.main:app"] + } + }, + "additionalProperties": false +} diff --git a/src/schemas/json/pyproject.json b/src/schemas/json/pyproject.json index cf25f47b040..e5f7f34e394 100644 --- a/src/schemas/json/pyproject.json +++ b/src/schemas/json/pyproject.json @@ -972,6 +972,11 @@ "title": "Wheel Builder", "description": "Build Python wheels for all platforms." }, + "fastapi": { + "$ref": "https://json.schemastore.org/partial-fastapi.json", + "title": "Web Framework", + "description": "FastAPI web framework configuration." + }, "mypy": { "$ref": "https://json.schemastore.org/partial-mypy.json", "title": "Static Type Checker", diff --git a/src/test/pyproject/fastapi.toml b/src/test/pyproject/fastapi.toml new file mode 100644 index 00000000000..d6febf9f601 --- /dev/null +++ b/src/test/pyproject/fastapi.toml @@ -0,0 +1,3 @@ +#:schema ../../schemas/json/pyproject.json +[tool.fastapi] +entrypoint = "backend.main:app"