Commit 1689d7b
Typescript-Angular: Fix several query parameters serialization issues (#22459)
* Generate skeleton for new integration test
* Typescript-angular: Move query param deep-object test
* typescript-angular: Add query param JSON test
* Typescript-angular: Add query param form test
* Test for #20998
* typescript-angular: Reimplement query param serialisation
This notably fixes:
- JSON query param serialisation
- array serialisation with style=form and explode=true
As the class HttpParams from Angular is specially designed for the
mimetype: `application/x-www-form-urlencoded` it does not support
the range of query parameters defined by the OpenAPI specification.
To workaround this issue, this patch introduces a custom
`OpenAPIHttpParams` class which supports a wider range of query param
styles.
Note that as `HttpClient` is used afterwards, the class
`OpenApiHttpParams` has a method to convert it into a `HttpParams` from
Angular with a no-op HttpParameterCodec to avoid double serialisation of
the query parameters.
* update samples
---------
Co-authored-by: Vladimir Svoboda <[email protected]>1 parent 08858a9 commit 1689d7b
File tree
254 files changed
+19753
-1290
lines changed- .github/workflows
- bin/configs
- modules/openapi-generator/src
- main
- java/org/openapitools/codegen/languages
- resources/typescript-angular
- test
- java/org/openapitools/codegen/typescript/typescriptangular
- resources/3_0
- samples/client
- others
- typescript-angular-v20
- builds
- query-param-deep-object
- .openapi-generator
- api
- model
- query-param-form
- .openapi-generator
- api
- model
- query-param-json
- .openapi-generator
- api
- model
- projects/app
- public
- src
- app
- typescript-angular/builds
- composed-schemas-tagged-unions
- .openapi-generator
- api
- composed-schemas
- .openapi-generator
- api
- petstore
- typescript-angular-v12-oneOf/builds/default
- .openapi-generator
- api
- typescript-angular-v12-provided-in-any/builds/default
- .openapi-generator
- api
- typescript-angular-v12-provided-in-root/builds
- default
- .openapi-generator
- api
- with-npm
- .openapi-generator
- api
- typescript-angular-v13-oneOf/builds/default
- .openapi-generator
- api
- typescript-angular-v13-provided-in-any/builds/default
- .openapi-generator
- api
- typescript-angular-v13-provided-in-root/builds
- default
- .openapi-generator
- api
- with-npm
- .openapi-generator
- api
- typescript-angular-v14-provided-in-root/builds/default
- .openapi-generator
- api
- typescript-angular-v14-query-param-object-format
- .openapi-generator
- api
- typescript-angular-v15-provided-in-root/builds/default
- .openapi-generator
- api
- typescript-angular-v16-provided-in-root/builds/default
- .openapi-generator
- api
- typescript-angular-v17-provided-in-root/builds/default
- .openapi-generator
- api
- typescript-angular-v18-provided-in-root/builds/default
- .openapi-generator
- api
- typescript-angular-v19-provided-in-root/builds/default
- .openapi-generator
- api
- typescript-angular-v19-with-angular-dependency-params/builds/default
- .openapi-generator
- api
- typescript-angular-v19
- builds
- deep-object
- default
- .openapi-generator
- api
- src
- typescript-angular-v20-provided-in-root/builds/default
- .openapi-generator
- api
- typescript-angular-v20/builds/default
- .openapi-generator
- api
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
254 files changed
+19753
-1290
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
This file was deleted.
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
Lines changed: 44 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 33 | + | |
41 | 34 | | |
42 | 35 | | |
43 | 36 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
53 | 41 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
57 | 55 | | |
58 | | - | |
59 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
68 | 84 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 85 | | |
73 | | - | |
74 | 86 | | |
75 | 87 | | |
Lines changed: 43 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
110 | | - | |
| 111 | + | |
111 | 112 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
136 | 151 | | |
137 | 152 | | |
138 | 153 | | |
| |||
291 | 306 | | |
292 | 307 | | |
293 | 308 | | |
294 | | - | |
| 309 | + | |
295 | 310 | | |
296 | 311 | | |
297 | 312 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments