-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[typescript][typescript-node] Serialize/deserialize maps and nullable…
… types correctly (#19362) * Remove deprecated suppressImplicitAnyIndexErrors property from templates * Add encoding / decoding tests for the typescript generator * Add encoding / decoding tests for the typescript-node generator * [Typescript][Typescript Node] fix deserializing complex types This fixes deserializing of models that are composed with null, undefined, or are inside of a map. * Use more sensible `startsWith` implementation * Remove use of magic number offsets * Fix endsWith bounds checking * Regenerate samples
- Loading branch information
1 parent
9147e99
commit a6581e8
Showing
89 changed files
with
14,438 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: TypeScript Client (Encoding / Decoding Test) | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- samples/client/others/typescript/encode-decode/** | ||
- .github/workflows/samples-typescript-encode-decode.yaml | ||
jobs: | ||
build: | ||
name: Test TypeScript Encoding / Decoding | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sample: | ||
# clients | ||
- samples/client/others/typescript/encode-decode/test | ||
node-version: | ||
- 16 | ||
- 18 | ||
- 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install | ||
working-directory: ${{ matrix.sample }} | ||
run: | | ||
npm run preinstall | ||
npm i | ||
- name: Test | ||
working-directory: ${{ matrix.sample }} | ||
run: npm test |
37 changes: 37 additions & 0 deletions
37
.github/workflows/samples-typescript-node-encode-decode.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: TypeScript Node Client (Encoding / Decoding Test) | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- samples/client/others/typescript-node/encode-decode/** | ||
- .github/workflows/samples-typescript-node-encode-decode.yaml | ||
jobs: | ||
build: | ||
name: Test TypeScript Node Encoding / Decoding | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sample: | ||
# clients | ||
- samples/client/others/typescript-node/encode-decode/test | ||
node-version: | ||
- 16 | ||
- 18 | ||
- 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install | ||
working-directory: ${{ matrix.sample }} | ||
run: | | ||
npm run preinstall | ||
npm i | ||
- name: Test | ||
working-directory: ${{ matrix.sample }} | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
generatorName: typescript | ||
outputDir: samples/client/others/typescript/encode-decode/build | ||
inputSpec: modules/openapi-generator/src/test/resources/3_1/encode-decode.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/typescript | ||
additionalProperties: | ||
artifactId: encode-decode-typescript | ||
hideGenerationTimestamp: "true" | ||
npmVersion: 1.0.0 | ||
npmName: '@openapitools/typescript-encode-decode' | ||
nullSafeAdditionalProps: true | ||
platform: node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
generatorName: typescript-node | ||
outputDir: samples/client/others/typescript-node/encode-decode/build | ||
inputSpec: modules/openapi-generator/src/test/resources/3_1/encode-decode.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/typescript-node | ||
additionalProperties: | ||
artifactId: encode-decode-typescript-node | ||
hideGenerationTimestamp: "true" | ||
npmVersion: 1.0.0 | ||
npmName: '@openapitools/typescript-node-encode-decode' | ||
nullSafeAdditionalProps: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.