From 08dcd040c3cb68762fc36cce7c41b380878601b9 Mon Sep 17 00:00:00 2001 From: Rubens Panfili Date: Fri, 17 Jul 2026 16:36:06 +0200 Subject: [PATCH 1/2] fix(openapi): down-convert OAS 3.1 constructs before SDK generation --- .github/workflows/publish.yaml | 8 ++++- package-lock.json | 65 ++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 88b39fc4..3d797092 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -25,10 +25,11 @@ jobs: with: node-version: "20" # Specify the Node.js version to use - # Step 3: Install openapi-merge-cli and openapi-generator-cli + # Step 3: Install openapi-merge-cli, openapi-down-convert and openapi-generator-cli - name: Install openapi-merge-cli run: | npm i openapi-merge-cli ajv uri-js + npm i @apiture/openapi-down-convert@^0.14.2 npm i @openapitools/openapi-generator-cli@~2.20.2 # Step 4: Set up Python @@ -60,6 +61,11 @@ jobs: - name: Merge the yaml files run: npx openapi-merge-cli --config ./openapi-merge.json + # Step 8b: Down-convert any OAS 3.1-only constructs (openapi-merge always declares + # 3.0.3 regardless of input, so source specs written for 3.1 need this to stay valid) + - name: Down-convert OpenAPI 3.1 constructs to 3.0 + run: npx openapi-down-convert --input ./wordliftApiSpec.yaml --output ./wordliftApiSpec.yaml + # Step 9: Normalize security scheme aliases in the merged spec - name: Normalize security scheme aliases run: python3 ./utils/normalize_security_schemes.py diff --git a/package-lock.json b/package-lock.json index 3485baf0..32ab77f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,64 @@ "version": "1.0.0", "license": "Apache License 2.0", "dependencies": { + "@apiture/openapi-down-convert": "^0.14.2", "@openapitools/openapi-generator-cli": "~2.20.2", "ajv": "^8.20.0", "openapi-merge-cli": "^1.3.2", "uri-js": "^4.4.1" } }, + "node_modules/@apiture/openapi-down-convert": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@apiture/openapi-down-convert/-/openapi-down-convert-0.14.2.tgz", + "integrity": "sha512-vT3eqOEmJ4KZ2qojycEV0zzFBPDrkwntyfnWi8/WMaag8jvGN4osIdVRuwxWcK6AvQr32ohrpcLGqEZ+ZHVNcw==", + "license": "ISC", + "dependencies": { + "commander": "^9.4.1", + "js-yaml": "^4.1.0", + "typescript": "^4.8.4" + }, + "bin": { + "openapi-down-convert": "lib/src/cli.js" + } + }, + "node_modules/@apiture/openapi-down-convert/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/@apiture/openapi-down-convert/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/@apiture/openapi-down-convert/node_modules/js-yaml": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@babel/runtime": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", @@ -2171,6 +2223,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/uid": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", diff --git a/package.json b/package.json index 333adc53..d86ded62 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Analyse content using Linked Data and Knowledge Graphs.", "license": "Apache License 2.0", "dependencies": { + "@apiture/openapi-down-convert": "^0.14.2", "@openapitools/openapi-generator-cli": "~2.20.2", "ajv": "^8.20.0", "openapi-merge-cli": "^1.3.2", From 5cb776d987f2ad19e3fa45845fb1037cbe0adf30 Mon Sep 17 00:00:00 2001 From: Rubens Panfili Date: Fri, 17 Jul 2026 16:58:08 +0200 Subject: [PATCH 2/2] ci(python-client): stop testing EOL Python 3.7 in generated workflow --- .github/workflows/python.yml | 10 ++++++---- .openapi-generator-ignore | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ebdec543..1362aeb1 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,4 +1,6 @@ -# NOTE: This file is auto generated by OpenAPI Generator. +# NOTE: This file was originally auto generated by OpenAPI Generator, but is now +# hand-maintained (listed in .openapi-generator-ignore) since the generator's +# default matrix includes EOL Python versions unavailable on current runners. # URL: https://openapi-generator.tech # # ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python @@ -13,12 +15,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 79b2e0d1..eb873b45 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -23,3 +23,7 @@ #!docs/README.md .gitignore + +# Hand-maintained: the generator's default matrix includes EOL Python 3.7, which +# GitHub-hosted Ubuntu runners no longer ship (Ubuntu 24.04 has no 3.7 build). +.github/workflows/python.yml