Skip to content

Commit a8d56fd

Browse files
IvanVasamakhrov
andauthored
Fixes the non-working query parameter when it's an Enum (#20210)
* Fixes the non-working query parameter when it's a Enum * Update modules/openapi-generator/src/main/resources/typescript/api/api.mustache Co-authored-by: Alexey Makhrov <[email protected]> * Fixes the tags order * Adds Echo API client tests for typescript: step 1 * Adds Echo API client tests for typescript: step 2 * Updates samples * Fixes updated samples * Fixes the fix * Fixes the example config --------- Co-authored-by: Alexey Makhrov <[email protected]>
1 parent 587fcff commit a8d56fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+9833
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
generatorName: typescript
2+
outputDir: samples/client/echo_api/typescript/build
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/typescript
5+
additionalProperties:
6+
artifactId: echo-api-typescript
7+
hideGenerationTimestamp: "true"
8+
platform: node
9+
npmVersion: 1.0.0
10+
npmName: '@openapitools/typescript-echo-api'

modules/openapi-generator/src/main/resources/typescript/api/api.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
7070
requestContext.setQueryParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
7171
{{/isPrimitiveType}}
7272
{{^isPrimitiveType}}
73+
{{#isEnumRef}}
74+
requestContext.setQueryParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
75+
{{/isEnumRef}}
76+
{{^isEnumRef}}
7377
{{#isExplode}}
7478
const serializedParams = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}");
7579
{{#isArray}}
@@ -86,6 +90,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
8690
{{^isExplode}}
8791
requestContext.setQueryParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
8892
{{/isExplode}}
93+
{{/isEnumRef}}
8994
{{/isPrimitiveType}}
9095
}
9196
{{/queryParams}}

samples/client/echo_api/typescript/build/.gitattributes

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/echo_api/typescript/build/.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/echo_api/typescript/build/.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/echo_api/typescript/build/.openapi-generator/FILES

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/echo_api/typescript/build/.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/echo_api/typescript/build/AuthApi.md

Lines changed: 103 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)