From 4a12da2494c19363cab027a2080c4dddaa03fbf7 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 Oct 2025 00:32:48 +0800 Subject: [PATCH 1/5] update samples --- .github/workflows/samples-javascript.yaml | 52 +++++++++++++++++++ .../javascript-es6/.openapi-generator-ignore | 3 ++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/samples-javascript.yaml diff --git a/.github/workflows/samples-javascript.yaml b/.github/workflows/samples-javascript.yaml new file mode 100644 index 000000000000..8b31cb460fd5 --- /dev/null +++ b/.github/workflows/samples-javascript.yaml @@ -0,0 +1,52 @@ +name: Samples JS clients + +on: + push: + paths: + - samples/client/petstore/javascript-flowtyped/** + - samples/client/petstore/javascript-es6/** + - samples/client/petstore/javascript-promise-es6/** + pull_request: + paths: + - samples/client/petstore/javascript-flowtyped/** + - samples/client/petstore/javascript-es6/** + - samples/client/petstore/javascript-promise-es6/** +jobs: + build: + name: Build PHP projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: + - "18.x" + - "20.x" + sample: + # clients + - samples/client/petstore/javascript-flowtyped/ + - samples/client/petstore/javascript-es6/ + - samples/client/petstore/javascript-promise-es6/ + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + steps: + - uses: actions/checkout@v5 + - name: Add hosts to /etc/hosts + run: | + sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: 'npm' # Or 'yarn' + - name: npm install + working-directory: ${{ matrix.sample }} + run: npm install + - name: npm test + working-directory: ${{ matrix.sample }} + run: npm test diff --git a/samples/client/petstore/javascript-es6/.openapi-generator-ignore b/samples/client/petstore/javascript-es6/.openapi-generator-ignore index 7484ee590a38..c5b04829c20a 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator-ignore +++ b/samples/client/petstore/javascript-es6/.openapi-generator-ignore @@ -21,3 +21,6 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +# +# +# From e97088a4c097f065d3631749945ba08b47b7d29e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 Oct 2025 00:35:00 +0800 Subject: [PATCH 2/5] fix name --- .github/workflows/samples-javascript.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/samples-javascript.yaml b/.github/workflows/samples-javascript.yaml index 8b31cb460fd5..44ec1d1f56e2 100644 --- a/.github/workflows/samples-javascript.yaml +++ b/.github/workflows/samples-javascript.yaml @@ -13,7 +13,7 @@ on: - samples/client/petstore/javascript-promise-es6/** jobs: build: - name: Build PHP projects + name: Build projects runs-on: ubuntu-latest strategy: fail-fast: false From a52bd927e8aa22f11d40c0d2163f9926507196f3 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 Oct 2025 00:44:45 +0800 Subject: [PATCH 3/5] update --- .github/workflows/samples-javascript.yaml | 4 ++-- CI/circle_parallel.sh | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/samples-javascript.yaml b/.github/workflows/samples-javascript.yaml index 44ec1d1f56e2..99721ee761e7 100644 --- a/.github/workflows/samples-javascript.yaml +++ b/.github/workflows/samples-javascript.yaml @@ -3,12 +3,12 @@ name: Samples JS clients on: push: paths: - - samples/client/petstore/javascript-flowtyped/** + #- samples/client/petstore/javascript-flowtyped/** - samples/client/petstore/javascript-es6/** - samples/client/petstore/javascript-promise-es6/** pull_request: paths: - - samples/client/petstore/javascript-flowtyped/** + #- samples/client/petstore/javascript-flowtyped/** - samples/client/petstore/javascript-es6/** - samples/client/petstore/javascript-promise-es6/** jobs: diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 58c1584b99b7..842c43f3ee98 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -107,9 +107,6 @@ elif [ "$NODE_INDEX" = "3" ]; then (cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test) (cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test) (cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test) - (cd samples/client/petstore/javascript-flowtyped && mvn integration-test) - (cd samples/client/petstore/javascript-es6 && mvn integration-test) - (cd samples/client/petstore/javascript-promise-es6 && mvn integration-test) (cd samples/server/petstore/typescript-nestjs-server && mvn integration-test) else From 36ad2061a195d195e58373d3be97ba61a4db8ced Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 Oct 2025 00:47:18 +0800 Subject: [PATCH 4/5] remove --- .github/workflows/samples-javascript.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/samples-javascript.yaml b/.github/workflows/samples-javascript.yaml index 99721ee761e7..bef859e1b576 100644 --- a/.github/workflows/samples-javascript.yaml +++ b/.github/workflows/samples-javascript.yaml @@ -23,7 +23,6 @@ jobs: - "20.x" sample: # clients - - samples/client/petstore/javascript-flowtyped/ - samples/client/petstore/javascript-es6/ - samples/client/petstore/javascript-promise-es6/ services: From 915e9476d572ac8fdaccf7be435e7369c03fb33f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 Oct 2025 00:55:44 +0800 Subject: [PATCH 5/5] clean up test --- .../test/model/HealthCheckResult.spec.js | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js diff --git a/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js b/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js deleted file mode 100644 index 25d9ecd929f0..000000000000 --- a/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', process.cwd()+'/src/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.OpenApiPetstore); - } -}(this, function(expect, OpenApiPetstore) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new OpenApiPetstore.HealthCheckResult(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('HealthCheckResult', function() { - it('should create an instance of HealthCheckResult', function() { - // uncomment below and update the code to test HealthCheckResult - //var instance = new OpenApiPetstore.HealthCheckResult(); - //expect(instance).to.be.a(OpenApiPetstore.HealthCheckResult); - }); - - it('should have the property nullableMessage (base name: "NullableMessage")', function() { - // uncomment below and update the code to test the property nullableMessage - //var instance = new OpenApiPetstore.HealthCheckResult(); - //expect(instance).to.be(); - }); - - }); - -}));