From 88e0000e5bae2d41982e810b882bfef49852d3f4 Mon Sep 17 00:00:00 2001 From: khayashi4337 Date: Fri, 13 Nov 2026 14:55:13 +0900 Subject: [PATCH 1/4] ci(python): check generated Python Connexion server code in a GitHub workflow The unit tests must not require a python3 toolchain (#25556). #25579 removed testJsonContentHeaderParamsGeneratedTestsCompile and re-enabled testInfoTitleEmbeddedAsPythonStringLiteral with Java-only assertions; this workflow restores the Python-level checks (py_compile of the generated tests and evaluating the setup() literals with ast): - bin/utils/check-python-connexion-generated.py runs py_compile on the generated test_default_controller.py (with warnings promoted to errors) and evaluates the setup() kwargs (description/author_email/long_description) with ast, comparing all three against the values the generator derives from the input spec's info object -- spec values where present, generator defaults otherwise. - The workflow builds the CLI, generates the two Connexion test specs under python-flask, python-flask useConnexion3=true, python-aiohttp and python-blueplanet (8 combinations), and runs the check script over each output. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- ...mples-python-connexion-generated-code.yaml | 97 ++++++++ bin/utils/check-python-connexion-generated.py | 217 ++++++++++++++++++ 2 files changed, 314 insertions(+) create mode 100644 .github/workflows/samples-python-connexion-generated-code.yaml create mode 100755 bin/utils/check-python-connexion-generated.py diff --git a/.github/workflows/samples-python-connexion-generated-code.yaml b/.github/workflows/samples-python-connexion-generated-code.yaml new file mode 100644 index 000000000000..285e669345fb --- /dev/null +++ b/.github/workflows/samples-python-connexion-generated-code.yaml @@ -0,0 +1,97 @@ +name: Python Connexion generated code + +on: + push: + paths: + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonStringUtils.java + - modules/openapi-generator/src/main/resources/python-flask/** + - modules/openapi-generator/src/main/resources/python-aiohttp/** + - modules/openapi-generator/src/main/resources/python-blueplanet/** + - modules/openapi-generator/src/test/java/org/openapitools/codegen/python/AbstractPythonConnexionServerCodegenTest.java + - modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml + - modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml + - bin/utils/check-python-connexion-generated.py + - .github/workflows/samples-python-connexion-generated-code.yaml + pull_request: + paths: + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java + - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonStringUtils.java + - modules/openapi-generator/src/main/resources/python-flask/** + - modules/openapi-generator/src/main/resources/python-aiohttp/** + - modules/openapi-generator/src/main/resources/python-blueplanet/** + - modules/openapi-generator/src/test/java/org/openapitools/codegen/python/AbstractPythonConnexionServerCodegenTest.java + - modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml + - modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml + - bin/utils/check-python-connexion-generated.py + - .github/workflows/samples-python-connexion-generated-code.yaml +jobs: + build: + name: Check generated Python Connexion server code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up JDK 11 + uses: actions/setup-java@v6 + with: + java-version: 11 + distribution: 'temurin' + - name: Cache maven dependencies + uses: actions/cache@v6 + env: + cache-name: cache-maven-repository + with: + path: | + ~/.m2/repository + ~/.gradle + !~/.gradle/caches/*/plugin-resolution/ + !~/.m2/repository/org/openapitools/ + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + - uses: actions/setup-python@v7 + with: + python-version: "3.11" + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install pyyaml + - name: Build openapi-generator-cli + run: ./mvnw -B -ntp -DskipTests -pl modules/openapi-generator-cli -am package + - name: Generate and check Connexion server variants + shell: bash + run: | + set -euo pipefail + out_dir="$RUNNER_TEMP/connexion-generated" + specs=( + modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml + modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml + ) + variants=( + "python-flask" + "python-flask useConnexion3=true" + "python-aiohttp" + "python-blueplanet" + ) + for spec in "${specs[@]}"; do + for variant in "${variants[@]}"; do + read -r generator option <<< "$variant" + dest="$out_dir/$(basename "$spec" .yaml)/${generator}${option:++connexion3}" + args=(generate -g "$generator" -i "$spec" -o "$dest") + if [ -n "${option:-}" ]; then + args+=(--additional-properties "$option") + fi + java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar "${args[@]}" + python3 bin/utils/check-python-connexion-generated.py "$dest" \ + --check-tests --check-setup "$spec" + done + done diff --git a/bin/utils/check-python-connexion-generated.py b/bin/utils/check-python-connexion-generated.py new file mode 100755 index 000000000000..d0389632a992 --- /dev/null +++ b/bin/utils/check-python-connexion-generated.py @@ -0,0 +1,217 @@ +#!/usr/bin/env python3 +"""Verify generated Python Connexion server code. + +Replaces the python3-dependent checks that used to live in +AbstractPythonConnexionServerCodegenTest (moved to a GitHub workflow so the +Java test suite does not require a python3 toolchain): + +1. ``--check-tests``: run ``py_compile`` on the generated + ``test_default_controller.py`` with warnings promoted to errors, the + same syntax check the removed Java test performed via + ``python3 -m py_compile``. +2. ``--check-setup``: parse the generated ``setup.py`` with ``ast`` and + assert that the ``setup()`` keyword arguments ``description``, + ``author_email`` and ``long_description`` evaluate to the values the + generator derives from the input spec's ``info`` object (see + ``expected_setup_kwargs`` for how each expected value, including the + generator defaults used when the spec provides no value, is + determined). + +Reports every mismatch it finds, then exits 1 if any check failed. +""" + +import argparse +import ast +import py_compile +import sys +import warnings +from pathlib import Path + +# Where each Connexion server variant puts the generated test module and +# setup.py, relative to the output directory (see generatedTestPath and the +# per-generator output layout in AbstractPythonConnexionServerCodegenTest). +TEST_FILE_CANDIDATES = ( + "openapi_server/test/test_default_controller.py", # python-flask + "tests/test_default_controller.py", # python-aiohttp + "app/openapi_server/test/test_default_controller.py", # python-blueplanet +) +SETUP_PY_CANDIDATES = ( + "setup.py", # python-flask, python-aiohttp + "app/setup.py", # python-blueplanet +) + + +def find_generated_file(generated_dir, candidates, name): + for rel in candidates: + path = generated_dir / rel + if path.is_file(): + return path + matches = sorted(p for p in generated_dir.rglob(name) if p.is_file()) + if len(matches) == 1: + return matches[0] + if matches: + raise FileNotFoundError( + f"multiple {name} files found under {generated_dir}, refusing " + f"to pick one: {', '.join(str(m) for m in matches)}" + ) + raise FileNotFoundError( + f"no {name} found under {generated_dir} " + f"(looked at {', '.join(candidates)} and recursively)" + ) + + +def check_tests_compile(test_file): + try: + with warnings.catch_warnings(): + warnings.simplefilter("error") + py_compile.compile(str(test_file), doraise=True) + except (py_compile.PyCompileError, Warning) as e: + print(f"FAIL: generated test {test_file} does not compile:\n{e}", file=sys.stderr) + return 1 + print(f"OK: {test_file} compiles") + return 0 + + +def load_spec_info(spec_path): + try: + import yaml + except ImportError: + sys.exit("PyYAML is required: pip install pyyaml") + try: + doc = yaml.safe_load(spec_path.read_text(encoding="utf-8")) + except OSError as e: + sys.exit(f"cannot read spec file {spec_path}: {e}") + except yaml.YAMLError as e: + sys.exit(f"cannot parse spec file {spec_path}: {e}") + if not isinstance(doc, dict) or not isinstance(doc.get("info"), dict): + sys.exit(f"{spec_path}: expected an OpenAPI document with an 'info' object") + return doc["info"] + + +# The boilerplate sentence AbstractPythonConnexionServerCodegen emits for +# long_description when the spec's info.description is missing or empty +# (mirroring the default DefaultGenerator assigns to the unescaped +# description), wrapped by setup.mustache's triple-quoted block. +DEFAULT_LONG_DESCRIPTION = ( + "No description provided (generated by Openapi Generator " + "https://github.com/openapitools/openapi-generator)" +) + + +def expected_setup_kwargs(info): + """The setup() kwarg values the generator emits for a spec's info. + + Mirrors what AbstractPythonConnexionServerCodegen.preprocessOpenAPI and + setup.mustache produce, so all three kwargs are always compared: + + - ``description`` is ``info.title`` (``""`` when the spec has none). + - ``author_email`` is ``info.contact.email`` (``""`` when the spec has + none; a different value would only appear if an ``infoEmail`` + generator option were passed, which this workflow does not do). + - ``long_description`` is ``info.description`` inside the + `` ...`` triple-quoted block of setup.mustache + (``" " + description + "\\n "``), or ``DEFAULT_LONG_DESCRIPTION`` + when the spec's description is missing or empty. + """ + contact = info.get("contact") or {} + if not isinstance(contact, dict): + contact = {} + title = info.get("title") + email = contact.get("email") + description = info.get("description") + return { + "description": str(title) if title is not None else "", + "author_email": str(email) if email is not None else "", + "long_description": " " + + (str(description) if description not in (None, "") else DEFAULT_LONG_DESCRIPTION) + + "\n ", + } + + +def setup_call_kwargs(setup_py): + tree = ast.parse(setup_py.read_text(encoding="utf-8"), filename=str(setup_py)) + call = next( + ( + n + for n in ast.walk(tree) + if isinstance(n, ast.Call) and getattr(n.func, "id", None) == "setup" + ), + None, + ) + if call is None: + raise ValueError(f"{setup_py}: no setup() call found") + return { + k.arg: ast.literal_eval(k.value) + for k in call.keywords + if isinstance(k.value, ast.Constant) + } + + +def check_setup_kwargs(setup_py, spec_path): + expected = expected_setup_kwargs(load_spec_info(spec_path)) + try: + kwargs = setup_call_kwargs(setup_py) + except (SyntaxError, ValueError) as e: + print(f"FAIL: could not evaluate setup() kwargs in {setup_py}: {e}", file=sys.stderr) + return 1 + failures = 0 + for key, want in expected.items(): + got = kwargs.get(key) + if got != want: + failures += 1 + print( + f"FAIL: {setup_py} setup() kwarg {key!r} mismatch:\n" + f" got {got!r}\n" + f" want {want!r}", + file=sys.stderr, + ) + if failures: + return 1 + print(f"OK: {setup_py} setup() kwargs match {spec_path}") + return 0 + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "generated_dir", + type=Path, + help="output directory of a generated Connexion server variant", + ) + parser.add_argument( + "--check-tests", + action="store_true", + help="py_compile the generated test_default_controller.py", + ) + parser.add_argument( + "--check-setup", + metavar="SPEC", + type=Path, + help="verify setup.py kwargs against the values the generator " + "derives from the info object of SPEC", + ) + args = parser.parse_args(argv) + if not (args.check_tests or args.check_setup): + parser.error("nothing to do: pass --check-tests and/or --check-setup SPEC") + + rc = 0 + try: + if args.check_tests: + rc |= check_tests_compile( + find_generated_file( + args.generated_dir, TEST_FILE_CANDIDATES, "test_default_controller.py" + ) + ) + if args.check_setup: + rc |= check_setup_kwargs( + find_generated_file(args.generated_dir, SETUP_PY_CANDIDATES, "setup.py"), + args.check_setup, + ) + except FileNotFoundError as e: + print(f"ERROR: {e}", file=sys.stderr) + return 1 + return rc + + +if __name__ == "__main__": + sys.exit(main()) From df29e14496b104da0aab399c9c3f468e58b40e72 Mon Sep 17 00:00:00 2001 From: khayashi4337 Date: Mon, 16 Nov 2026 01:53:40 +0900 Subject: [PATCH 2/4] ci(python): trigger the Connexion code check on sample paths Use the generated server sample paths for push/pull_request triggers, per wing328's review on PR #25654. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- ...mples-python-connexion-generated-code.yaml | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/workflows/samples-python-connexion-generated-code.yaml b/.github/workflows/samples-python-connexion-generated-code.yaml index 285e669345fb..71a9e3015b28 100644 --- a/.github/workflows/samples-python-connexion-generated-code.yaml +++ b/.github/workflows/samples-python-connexion-generated-code.yaml @@ -3,34 +3,18 @@ name: Python Connexion generated code on: push: paths: - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonStringUtils.java - - modules/openapi-generator/src/main/resources/python-flask/** - - modules/openapi-generator/src/main/resources/python-aiohttp/** - - modules/openapi-generator/src/main/resources/python-blueplanet/** - - modules/openapi-generator/src/test/java/org/openapitools/codegen/python/AbstractPythonConnexionServerCodegenTest.java - - modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml - - modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml + - samples/server/petstore/python-flask/** + - samples/server/petstore/python-flask-connexion3/** + - samples/server/petstore/python-aiohttp-srclayout/** + - samples/server/petstore/python-blueplanet/** - bin/utils/check-python-connexion-generated.py - .github/workflows/samples-python-connexion-generated-code.yaml pull_request: paths: - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java - - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonStringUtils.java - - modules/openapi-generator/src/main/resources/python-flask/** - - modules/openapi-generator/src/main/resources/python-aiohttp/** - - modules/openapi-generator/src/main/resources/python-blueplanet/** - - modules/openapi-generator/src/test/java/org/openapitools/codegen/python/AbstractPythonConnexionServerCodegenTest.java - - modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml - - modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml + - samples/server/petstore/python-flask/** + - samples/server/petstore/python-flask-connexion3/** + - samples/server/petstore/python-aiohttp-srclayout/** + - samples/server/petstore/python-blueplanet/** - bin/utils/check-python-connexion-generated.py - .github/workflows/samples-python-connexion-generated-code.yaml jobs: From 8d55e90ba11056944b046e9b8dd5954b9cd25418 Mon Sep 17 00:00:00 2001 From: khayashi4337 Date: Mon, 16 Nov 2026 02:42:35 +0900 Subject: [PATCH 3/4] ci(python): run the Connexion code check through a single script Per wing328's review on PR #25654, replace the inline test step with a single bin/utils/test-python-connexion-generated.sh call so the job runs the same check with one command, like the other sample workflows. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- ...mples-python-connexion-generated-code.yaml | 32 ++----------- bin/utils/test-python-connexion-generated.sh | 46 +++++++++++++++++++ 2 files changed, 50 insertions(+), 28 deletions(-) create mode 100755 bin/utils/test-python-connexion-generated.sh diff --git a/.github/workflows/samples-python-connexion-generated-code.yaml b/.github/workflows/samples-python-connexion-generated-code.yaml index 71a9e3015b28..d83a4e949594 100644 --- a/.github/workflows/samples-python-connexion-generated-code.yaml +++ b/.github/workflows/samples-python-connexion-generated-code.yaml @@ -8,6 +8,7 @@ on: - samples/server/petstore/python-aiohttp-srclayout/** - samples/server/petstore/python-blueplanet/** - bin/utils/check-python-connexion-generated.py + - bin/utils/test-python-connexion-generated.sh - .github/workflows/samples-python-connexion-generated-code.yaml pull_request: paths: @@ -16,6 +17,7 @@ on: - samples/server/petstore/python-aiohttp-srclayout/** - samples/server/petstore/python-blueplanet/** - bin/utils/check-python-connexion-generated.py + - bin/utils/test-python-connexion-generated.sh - .github/workflows/samples-python-connexion-generated-code.yaml jobs: build: @@ -51,31 +53,5 @@ jobs: pip install pyyaml - name: Build openapi-generator-cli run: ./mvnw -B -ntp -DskipTests -pl modules/openapi-generator-cli -am package - - name: Generate and check Connexion server variants - shell: bash - run: | - set -euo pipefail - out_dir="$RUNNER_TEMP/connexion-generated" - specs=( - modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml - modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml - ) - variants=( - "python-flask" - "python-flask useConnexion3=true" - "python-aiohttp" - "python-blueplanet" - ) - for spec in "${specs[@]}"; do - for variant in "${variants[@]}"; do - read -r generator option <<< "$variant" - dest="$out_dir/$(basename "$spec" .yaml)/${generator}${option:++connexion3}" - args=(generate -g "$generator" -i "$spec" -o "$dest") - if [ -n "${option:-}" ]; then - args+=(--additional-properties "$option") - fi - java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar "${args[@]}" - python3 bin/utils/check-python-connexion-generated.py "$dest" \ - --check-tests --check-setup "$spec" - done - done + - name: Test + run: /bin/bash ./bin/utils/test-python-connexion-generated.sh diff --git a/bin/utils/test-python-connexion-generated.sh b/bin/utils/test-python-connexion-generated.sh new file mode 100755 index 000000000000..9e8d3a0d588d --- /dev/null +++ b/bin/utils/test-python-connexion-generated.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# Generate the 2 test specs with the 4 Connexion-related generators +# (python-flask, python-flask with useConnexion3, python-aiohttp, +# python-blueplanet) and check each output with +# check-python-connexion-generated.py. +# +# Prerequisite: modules/openapi-generator-cli/target/openapi-generator-cli.jar +# must already be built. +# Usage: test-python-connexion-generated.sh [output_dir] (default: mktemp -d) + +set -euo pipefail + +cd "$(dirname "$0")/../.." + +executable="modules/openapi-generator-cli/target/openapi-generator-cli.jar" +if [ ! -f "$executable" ]; then + echo "ERROR: $executable not found. Build it first with:" >&2 + echo " ./mvnw -B -ntp -DskipTests -pl modules/openapi-generator-cli -am package" >&2 + exit 1 +fi + +out_dir="${1:-$(mktemp -d)}" +specs=( + modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml + modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml +) +variants=( + "python-flask" + "python-flask useConnexion3=true" + "python-aiohttp" + "python-blueplanet" +) +for spec in "${specs[@]}"; do + for variant in "${variants[@]}"; do + read -r generator option <<< "$variant" + dest="$out_dir/$(basename "$spec" .yaml)/${generator}${option:++connexion3}" + args=(generate -g "$generator" -i "$spec" -o "$dest") + if [ -n "${option:-}" ]; then + args+=(--additional-properties "$option") + fi + java -jar "$executable" "${args[@]}" + python3 bin/utils/check-python-connexion-generated.py "$dest" \ + --check-tests --check-setup "$spec" + done +done From 24db25656700b3b6c4ebdfed6cbf05c30e9d3a3c Mon Sep 17 00:00:00 2001 From: khayashi4337 Date: Mon, 16 Nov 2026 02:58:26 +0900 Subject: [PATCH 4/4] ci(python): also trigger the Connexion code check on its test specs - Add the two Connexion test specs to the workflow trigger paths - Document the java and PyYAML prerequisites and that a relative output_dir resolves against the repository root - Print the output directory at the start of the test script Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- .../samples-python-connexion-generated-code.yaml | 4 ++++ bin/utils/test-python-connexion-generated.sh | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/samples-python-connexion-generated-code.yaml b/.github/workflows/samples-python-connexion-generated-code.yaml index d83a4e949594..4a8df8ed4fac 100644 --- a/.github/workflows/samples-python-connexion-generated-code.yaml +++ b/.github/workflows/samples-python-connexion-generated-code.yaml @@ -9,6 +9,8 @@ on: - samples/server/petstore/python-blueplanet/** - bin/utils/check-python-connexion-generated.py - bin/utils/test-python-connexion-generated.sh + - modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml + - modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml - .github/workflows/samples-python-connexion-generated-code.yaml pull_request: paths: @@ -18,6 +20,8 @@ on: - samples/server/petstore/python-blueplanet/** - bin/utils/check-python-connexion-generated.py - bin/utils/test-python-connexion-generated.sh + - modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml + - modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml - .github/workflows/samples-python-connexion-generated-code.yaml jobs: build: diff --git a/bin/utils/test-python-connexion-generated.sh b/bin/utils/test-python-connexion-generated.sh index 9e8d3a0d588d..6401c0f27c9b 100755 --- a/bin/utils/test-python-connexion-generated.sh +++ b/bin/utils/test-python-connexion-generated.sh @@ -5,9 +5,13 @@ # python-blueplanet) and check each output with # check-python-connexion-generated.py. # -# Prerequisite: modules/openapi-generator-cli/target/openapi-generator-cli.jar -# must already be built. +# Prerequisites: +# - modules/openapi-generator-cli/target/openapi-generator-cli.jar +# must already be built. +# - java and python3 with PyYAML (python3 -m pip install pyyaml). # Usage: test-python-connexion-generated.sh [output_dir] (default: mktemp -d) +# A relative output_dir is resolved against the repository root, +# because this script changes to the repository root first. set -euo pipefail @@ -21,6 +25,7 @@ if [ ! -f "$executable" ]; then fi out_dir="${1:-$(mktemp -d)}" +echo "Output directory: $out_dir" specs=( modules/openapi-generator/src/test/resources/3_0/python/connexion-json-header-test-values.yaml modules/openapi-generator/src/test/resources/3_0/python/info-title-special-chars.yaml