Skip to content

Commit 3dd8d44

Browse files
committed
Change v1 to v2 in generated OpenAPI schema files
To remove confusion with APIv1, let's align filesnames too.
1 parent 72ed8de commit 3dd8d44

18 files changed

Lines changed: 19 additions & 19 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ repos:
133133
- --fuzzy-match-generates-todo
134134
- id: insert-license
135135
name: Add license for all YAML files except Helm templates
136-
exclude: ^\.github/.*$|^chart/templates/.*|.*reproducible_build\.yaml$|^.*/v1.*\.yaml$|^.*/openapi/_private_ui.*\.yaml$|^.*/pnpm-lock\.yaml$
136+
exclude: ^\.github/.*$|^chart/templates/.*|.*reproducible_build\.yaml$|^.*/v2.*\.yaml$|^.*/openapi/_private_ui.*\.yaml$|^.*/pnpm-lock\.yaml$
137137
types: [yaml]
138138
files: \.ya?ml$
139139
args:
@@ -1378,7 +1378,7 @@ repos:
13781378
entry: >
13791379
bash -c '
13801380
uv run -p 3.12 --no-dev --no-progress --active --group codegen --project apache-airflow-ctl --directory airflow-ctl/ datamodel-codegen &&
1381-
uv run -p 3.12 --no-dev --no-progress --active --group codegen --project apache-airflow-ctl --directory airflow-ctl/ datamodel-codegen --input="../airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v1-simple-auth-manager-generated.yaml" --output="src/airflowctl/api/datamodels/auth_generated.py"'
1381+
uv run -p 3.12 --no-dev --no-progress --active --group codegen --project apache-airflow-ctl --directory airflow-ctl/ datamodel-codegen --input="../airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v2-simple-auth-manager-generated.yaml" --output="src/airflowctl/api/datamodels/auth_generated.py"'
13821382
pass_filenames: false
13831383
files: ^airflow-core/src/airflow/api_fastapi/core_api/datamodels/.*\.py$|^airflow-core/src/airflow/api_fastapi/auth/managers/simple/datamodels/.*\.py$
13841384
require_serial: true

airflow-core/docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ def add_airflow_core_exclude_patterns_to_sphinx(exclude_patterns: list[str]):
349349

350350
graphviz_output_format = "svg"
351351

352-
main_openapi_path = Path(main_openapi_file).parent.joinpath("v1-rest-api-generated.yaml")
353-
sam_openapi_path = Path(sam_openapi_file).parent.joinpath("v1-simple-auth-manager-generated.yaml")
352+
main_openapi_path = Path(main_openapi_file).parent.joinpath("v2-rest-api-generated.yaml")
353+
sam_openapi_path = Path(sam_openapi_file).parent.joinpath("v2-simple-auth-manager-generated.yaml")
354354
redoc = [
355355
{
356356
"name": "Simple auth manager token API",

airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v1-simple-auth-manager-generated.yaml renamed to airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v2-simple-auth-manager-generated.yaml

File renamed without changes.

airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint:fix": "eslint --fix && tsc --p tsconfig.app.json",
1111
"format": "pnpm prettier --write .",
1212
"preview": "vite preview",
13-
"codegen": "openapi-rq -i \"../openapi/v1-simple-auth-manager-generated.yaml\" -c axios --format prettier -o openapi-gen --operationId",
13+
"codegen": "openapi-rq -i \"../openapi/v2-simple-auth-manager-generated.yaml\" -c axios --format prettier -o openapi-gen --operationId",
1414
"test": "vitest run",
1515
"coverage": "vitest run --coverage"
1616
},

airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml renamed to airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml

File renamed without changes.

airflow-core/src/airflow/ui/openapi-merge.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"inputs": [
33
{
4-
"inputFile": "../api_fastapi/core_api/openapi/v1-rest-api-generated.yaml"
4+
"inputFile": "../api_fastapi/core_api/openapi/v2-rest-api-generated.yaml"
55
},
66
{
77
"inputFile": "../api_fastapi/core_api/openapi/_private_ui.yaml"

airflow-ctl/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ use-standard-collections=true # list[] not List[]
137137
use-subclass-enum=true # enum, not union of Literals
138138
use-union-operator=true # 3.9+annotations, not `Union[]`
139139

140-
input = "../airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml"
140+
input = "../airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml"
141141
output = "src/airflowctl/api/datamodels/generated.py"
142142

143143
## pytest settings ##

airflow-ctl/src/airflowctl/api/datamodels/auth_generated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# generated by datamodel-codegen:
2-
# filename: v1-simple-auth-manager-generated.yaml
2+
# filename: v2-simple-auth-manager-generated.yaml
33
# version: 0.28.2
44

55
from __future__ import annotations

airflow-ctl/src/airflowctl/api/datamodels/generated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# generated by datamodel-codegen:
2-
# filename: v1-rest-api-generated.yaml
2+
# filename: v2-rest-api-generated.yaml
33
# version: 0.28.2
44

55
from __future__ import annotations

contributing-docs/16_adding_api_endpoints.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Step 4: Run Pre-commit Hooks
7474
-----------------------------
7575
1. Ensure all code meets the project's quality standards by running pre-commit hooks.
7676
2. Pre-commit hooks include static code checks, formatting, and other validations.
77-
3. Persisted openapi spec is located in ``v1-rest-api-generated.yaml` and a hook will take care of updating it based on your new endpoint, you just need to add and commit the change.
77+
3. Persisted openapi spec is located in ``v2-rest-api-generated.yaml` and a hook will take care of updating it based on your new endpoint, you just need to add and commit the change.
7878
4. Run the following command to execute all pre-commit hooks:
7979
8080
.. code-block:: bash

0 commit comments

Comments
 (0)