This is an automated email from the ASF dual-hosted git repository.
kamilbregula pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new ab07891 Add missing x-openapi-router-controller to DAG Run endpoint
(#9945)
ab07891 is described below
commit ab07891466d305b273ba7acf66db84248d9e8f83
Author: QP Hou <[email protected]>
AuthorDate: Sat Jul 25 11:47:40 2020 -0700
Add missing x-openapi-router-controller to DAG Run endpoint (#9945)
---
.pre-commit-config.yaml | 2 +-
airflow/api_connexion/openapi/v1.yaml | 3 ++-
scripts/ci/openapi/client_codegen_diff.sh | 2 +-
scripts/ci/speccy_rules/connexion.yml | 22 ++++++++++++++++++++++
4 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d02d6e8..b9a3d1e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -194,7 +194,7 @@ repos:
- id: lint-openapi
name: Lint OpenAPI using speccy
language: docker_image
- entry: wework/speccy lint
+ entry: wework/speccy lint -r default -r
./scripts/ci/speccy_rules/connexion.yml
files: ^airflow/api_connexion/openapi/
- id: lint-openapi
name: Lint OpenAPI using openapi-spec-validator
diff --git a/airflow/api_connexion/openapi/v1.yaml
b/airflow/api_connexion/openapi/v1.yaml
index ebd4aa2..5f7e339 100644
--- a/airflow/api_connexion/openapi/v1.yaml
+++ b/airflow/api_connexion/openapi/v1.yaml
@@ -289,7 +289,8 @@ paths:
post:
summary: Trigger a DAG Run
- operationId:
airflow.api_connexion.endpoints.dag_run_endpoint.post_dag_run
+ x-openapi-router-controller:
airflow.api_connexion.endpoints.dag_run_endpoint
+ operationId: post_dag_run
tags: [DAGRun]
requestBody:
required: true
diff --git a/scripts/ci/openapi/client_codegen_diff.sh
b/scripts/ci/openapi/client_codegen_diff.sh
index 9a8511b..688a06f 100755
--- a/scripts/ci/openapi/client_codegen_diff.sh
+++ b/scripts/ci/openapi/client_codegen_diff.sh
@@ -48,4 +48,4 @@ mkdir -p ./clients/go_target_branch/airflow
git reset --hard "${TARGET_REMOTE}/${CI_TARGET_BRANCH}"
./clients/gen/go.sh ./airflow/api_connexion/openapi/v1.yaml
./clients/go_target_branch/airflow
-diff ./clients/go_target_branch/airflow ./clients/go/airflow || true
+diff -u ./clients/go_target_branch/airflow ./clients/go/airflow || true
diff --git a/scripts/ci/speccy_rules/connexion.yml
b/scripts/ci/speccy_rules/connexion.yml
new file mode 100644
index 0000000..4a0c057
--- /dev/null
+++ b/scripts/ci/speccy_rules/connexion.yml
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+---
+rules:
+ - name: operation-x-openapi-router-controller
+ object: operation
+ description: operation should have a x-openapi-router-controller attribute
+ truthy: x-openapi-router-controller