@rxap/open-api 18.0.10-dev.0 → 19.0.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/compodoc/changelog.html +50 -0
  4. package/compodoc/classes/OpenApiHttpResponseError.html +29 -0
  5. package/compodoc/classes/SchemaValidationMixin.html +83 -20
  6. package/compodoc/dependencies.html +12 -12
  7. package/compodoc/index.html +1 -1
  8. package/compodoc/interfaces/SchemaValidationResponse.html +65 -2
  9. package/compodoc/js/menu-wc_es5.js +1 -1
  10. package/compodoc/js/search/search_index.js +2 -2
  11. package/compodoc/properties.html +1 -1
  12. package/docs/assets/search.js +1 -1
  13. package/docs/classes/OpenApiConfigService.html +4 -4
  14. package/docs/classes/OpenApiHttpResponseError.html +8 -7
  15. package/docs/classes/RxapOpenApiError.html +5 -11
  16. package/docs/classes/SchemaValidationMixin.html +7 -6
  17. package/docs/documentation.json +873 -1003
  18. package/docs/functions/AssertOpenApiV3.html +1 -1
  19. package/docs/functions/IsOpenApiV3.html +1 -1
  20. package/docs/functions/IsReferenceObject.html +1 -1
  21. package/docs/functions/NotContainsReferenceObjects.html +1 -1
  22. package/docs/functions/OpenApiInit.html +1 -1
  23. package/docs/index.html +1 -1
  24. package/docs/interfaces/OpenApiInitOptions.html +3 -3
  25. package/docs/interfaces/OpenApiMetaData.html +5 -5
  26. package/docs/interfaces/OperationObjectWithMetadata.html +2 -2
  27. package/docs/interfaces/SchemaValidationResponse.html +2 -2
  28. package/docs/types/OperationMap.html +1 -1
  29. package/docs/variables/DEFAULT_OPEN_API_DATA_SOURCE_META_DATA.html +1 -1
  30. package/docs/variables/DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA.html +1 -1
  31. package/docs/variables/DISABLE_SCHEMA_VALIDATION.html +1 -1
  32. package/docs/variables/DISABLE_VALIDATION.html +1 -1
  33. package/docs/variables/RXAP_OPEN_API_CONFIG.html +1 -1
  34. package/docs/variables/RXAP_OPEN_API_STRICT_VALIDATOR.html +1 -1
  35. package/fesm2022/rxap-open-api-data-source-table.mjs +11 -10
  36. package/fesm2022/rxap-open-api-data-source-table.mjs.map +1 -1
  37. package/fesm2022/rxap-open-api-data-source.mjs +6 -6
  38. package/fesm2022/rxap-open-api-data-source.mjs.map +1 -1
  39. package/fesm2022/rxap-open-api-remote-method.mjs +6 -6
  40. package/fesm2022/rxap-open-api-remote-method.mjs.map +1 -1
  41. package/fesm2022/rxap-open-api.mjs +3 -3
  42. package/fesm2022/rxap-open-api.mjs.map +1 -1
  43. package/package.json +30 -39
  44. package/theme.css +130 -1
  45. package/esm2022/data-source/index.mjs +0 -6
  46. package/esm2022/data-source/lib/error.mjs +0 -8
  47. package/esm2022/data-source/lib/open-api-data-source.loader.mjs +0 -36
  48. package/esm2022/data-source/lib/open-api.data-source.mjs +0 -155
  49. package/esm2022/data-source/rxap-open-api-data-source.mjs +0 -5
  50. package/esm2022/data-source/table/index.mjs +0 -7
  51. package/esm2022/data-source/table/lib/error.mjs +0 -8
  52. package/esm2022/data-source/table/lib/open-api-table.data-source.mjs +0 -131
  53. package/esm2022/data-source/table/lib/to-open-api-table-data-source.pipe.mjs +0 -29
  54. package/esm2022/data-source/table/lib/tokens.mjs +0 -3
  55. package/esm2022/data-source/table/rxap-open-api-data-source-table.mjs +0 -5
  56. package/esm2022/index.mjs +0 -12
  57. package/esm2022/lib/error.mjs +0 -7
  58. package/esm2022/lib/open-api-config.service.mjs +0 -172
  59. package/esm2022/lib/open-api-http-response.error.mjs +0 -25
  60. package/esm2022/lib/open-api-init.mjs +0 -28
  61. package/esm2022/lib/open-api.meta-data.mjs +0 -2
  62. package/esm2022/lib/open-api.mjs +0 -2
  63. package/esm2022/lib/schema-validation.mixin.mjs +0 -321
  64. package/esm2022/lib/tokens.mjs +0 -14
  65. package/esm2022/lib/utilities.mjs +0 -16
  66. package/esm2022/remote-method/index.mjs +0 -7
  67. package/esm2022/remote-method/lib/error.mjs +0 -8
  68. package/esm2022/remote-method/lib/get-page-adapter.factory.mjs +0 -52
  69. package/esm2022/remote-method/lib/open-api-remote-method.loader.mjs +0 -37
  70. package/esm2022/remote-method/lib/open-api.remote-method.mjs +0 -179
  71. package/esm2022/remote-method/rxap-open-api-remote-method.mjs +0 -5
  72. package/esm2022/rxap-open-api.mjs +0 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [19.0.0-dev.2](https://gitlab.com/rxap/packages/compare/@rxap/open-api@19.0.0-dev.1...@rxap/open-api@19.0.0-dev.2) (2025-01-03)
7
+
8
+ **Note:** Version bump only for package @rxap/open-api
9
+
10
+ # [19.0.0-dev.1](https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.10-dev.0...@rxap/open-api@19.0.0-dev.1) (2024-12-11)
11
+
12
+ **Note:** Version bump only for package @rxap/open-api
13
+
6
14
  ## [18.0.10-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.9...@rxap/open-api@18.0.10-dev.0) (2024-12-10)
7
15
 
8
16
  **Note:** Version bump only for package @rxap/open-api
package/README.md CHANGED
@@ -19,7 +19,7 @@ yarn add @rxap/open-api
19
19
  ```
20
20
  **Install peer dependencies:**
21
21
  ```bash
22
- yarn add @angular/common@^18.0.1 @angular/core@^18.0.1 @rxap/config@^18.1.1 @rxap/data-source@^18.1.1 @rxap/environment@^18.0.3 @rxap/mixin@^16.0.6 @rxap/remote-method@^18.0.3 @rxap/rxjs@^1.1.6 @rxap/utilities@^16.2.4 rxjs@^7.8.1
22
+ yarn add @angular/common@19.0.3 @angular/core@19.0.3 @rxap/config@^19.0.0-dev.2 @rxap/data-source@^19.0.0-dev.2 @rxap/environment@^19.0.0-dev.2 @rxap/mixin@^16.0.11-dev.2 @rxap/remote-method@^19.0.0-dev.2 @rxap/rxjs@^1.1.11-dev.2 @rxap/utilities@^16.4.1-dev.2 rxjs@7.8.1
23
23
  ```
24
24
  **Execute the init generator:**
25
25
  ```bash
@@ -85,6 +85,56 @@
85
85
  <h1>Change Log</h1>
86
86
  <p>All notable changes to this project will be documented in this file.
87
87
  See <a href="https://conventionalcommits.org">Conventional Commits</a> for commit guidelines.</p>
88
+ <h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@19.0.0-dev.1...@rxap/open-api@19.0.0-dev.2">19.0.0-dev.2</a> (2025-01-03)</h1>
89
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
90
+ <h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.10-dev.0...@rxap/open-api@19.0.0-dev.1">19.0.0-dev.1</a> (2024-12-11)</h1>
91
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
92
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.9...@rxap/open-api@18.0.10-dev.0">18.0.10-dev.0</a> (2024-12-10)</h2>
93
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
94
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.9-dev.0...@rxap/open-api@18.0.9">18.0.9</a> (2024-12-10)</h2>
95
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
96
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.8...@rxap/open-api@18.0.9-dev.0">18.0.9-dev.0</a> (2024-10-30)</h2>
97
+ <h3>Bug Fixes</h3>
98
+ <ul>
99
+ <li>remove __archived concept (<a href="https://gitlab.com/rxap/packages/commit/6cd40d605ac0c9d45e2e446ac2424a082a6e004e">6cd40d6</a>)</li>
100
+ </ul>
101
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.8-dev.2...@rxap/open-api@18.0.8">18.0.8</a> (2024-10-28)</h2>
102
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
103
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.8-dev.1...@rxap/open-api@18.0.8-dev.2">18.0.8-dev.2</a> (2024-10-25)</h2>
104
+ <h3>Bug Fixes</h3>
105
+ <ul>
106
+ <li>use utility function (<a href="https://gitlab.com/rxap/packages/commit/3cf87c0197971e4f033889ecafc87d615d7a8b02">3cf87c0</a>)</li>
107
+ </ul>
108
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.8-dev.0...@rxap/open-api@18.0.8-dev.1">18.0.8-dev.1</a> (2024-10-23)</h2>
109
+ <h3>Bug Fixes</h3>
110
+ <ul>
111
+ <li>support other content types then json (<a href="https://gitlab.com/rxap/packages/commit/d3ba7c43bd7d72b853979fd3df69586c7dc33486">d3ba7c4</a>)</li>
112
+ </ul>
113
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.7...@rxap/open-api@18.0.8-dev.0">18.0.8-dev.0</a> (2024-10-04)</h2>
114
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
115
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.7-dev.0...@rxap/open-api@18.0.7">18.0.7</a> (2024-09-18)</h2>
116
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
117
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.6...@rxap/open-api@18.0.7-dev.0">18.0.7-dev.0</a> (2024-08-27)</h2>
118
+ <h3>Bug Fixes</h3>
119
+ <ul>
120
+ <li>add server id getter (<a href="https://gitlab.com/rxap/packages/commit/e9ffaaa736338abeb185a1a78c8d8b6bcd4a5b9a">e9ffaaa</a>)</li>
121
+ </ul>
122
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.6-dev.0...@rxap/open-api@18.0.6">18.0.6</a> (2024-08-22)</h2>
123
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
124
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.5...@rxap/open-api@18.0.6-dev.0">18.0.6-dev.0</a> (2024-08-22)</h2>
125
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
126
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.5-dev.2...@rxap/open-api@18.0.5">18.0.5</a> (2024-07-30)</h2>
127
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
128
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.5-dev.1...@rxap/open-api@18.0.5-dev.2">18.0.5-dev.2</a> (2024-07-25)</h2>
129
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
130
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.5-dev.0...@rxap/open-api@18.0.5-dev.1">18.0.5-dev.1</a> (2024-07-09)</h2>
131
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
132
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.4...@rxap/open-api@18.0.5-dev.0">18.0.5-dev.0</a> (2024-07-03)</h2>
133
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
134
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.4-dev.0...@rxap/open-api@18.0.4">18.0.4</a> (2024-06-30)</h2>
135
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
136
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.3...@rxap/open-api@18.0.4-dev.0">18.0.4-dev.0</a> (2024-06-30)</h2>
137
+ <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
88
138
  <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.3-dev.1...@rxap/open-api@18.0.3">18.0.3</a> (2024-06-28)</h2>
89
139
  <p><strong>Note:</strong> Version bump only for package @rxap/open-api</p>
90
140
  <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@18.0.3-dev.0...@rxap/open-api@18.0.3-dev.1">18.0.3-dev.1</a> (2024-06-21)</h2>
@@ -175,6 +175,9 @@
175
175
  <li>
176
176
  <a href="#operationId" >operationId</a>
177
177
  </li>
178
+ <li>
179
+ <a href="#serverId" >serverId</a>
180
+ </li>
178
181
  </ul>
179
182
  </td>
180
183
  </tr>
@@ -338,6 +341,28 @@
338
341
 
339
342
  </tbody>
340
343
  </table>
344
+ <table class="table table-sm table-bordered">
345
+ <tbody>
346
+ <tr>
347
+ <td class="col-md-4">
348
+ <a name="serverId"></a>
349
+ <span class="name"><b>serverId</b><a href="#serverId"><span class="icon ion-ios-link"></span></a></span>
350
+ </td>
351
+ </tr>
352
+
353
+ <tr>
354
+ <td class="col-md-4">
355
+ <span class="accessor"><b>get</b><code>serverId()</code></span>
356
+ </td>
357
+ </tr>
358
+ <tr>
359
+ <td class="col-md-4">
360
+ <div class="io-line">Defined in <a href="" data-line="27" class="link-to-prism">src/lib/open-api-http-response.error.ts:27</a></div>
361
+ </td>
362
+ </tr>
363
+
364
+ </tbody>
365
+ </table>
341
366
  </section>
342
367
  </div>
343
368
 
@@ -369,6 +394,10 @@ export class OpenApiHttpResponseError extends HttpErrorResponse {
369
394
  return this.metadata.id;
370
395
  }
371
396
 
397
+ get serverId() {
398
+ return this.metadata.serverId;
399
+ }
400
+
372
401
  }
373
402
  </code></pre>
374
403
  </div>
@@ -231,7 +231,7 @@
231
231
  </tr>
232
232
  <tr>
233
233
  <td class="col-md-4">
234
- <div class="io-line">Defined in <a href="" data-line="29" class="link-to-prism">src/lib/schema-validation.mixin.ts:29</a></div>
234
+ <div class="io-line">Defined in <a href="" data-line="35" class="link-to-prism">src/lib/schema-validation.mixin.ts:35</a></div>
235
235
  </td>
236
236
  </tr>
237
237
 
@@ -257,7 +257,7 @@
257
257
  </tr>
258
258
  <tr>
259
259
  <td class="col-md-4">
260
- <div class="io-line">Defined in <a href="" data-line="27" class="link-to-prism">src/lib/schema-validation.mixin.ts:27</a></div>
260
+ <div class="io-line">Defined in <a href="" data-line="33" class="link-to-prism">src/lib/schema-validation.mixin.ts:33</a></div>
261
261
  </td>
262
262
  </tr>
263
263
 
@@ -293,8 +293,8 @@
293
293
 
294
294
  <tr>
295
295
  <td class="col-md-4">
296
- <div class="io-line">Defined in <a href="" data-line="287"
297
- class="link-to-prism">src/lib/schema-validation.mixin.ts:287</a></div>
296
+ <div class="io-line">Defined in <a href="" data-line="293"
297
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:293</a></div>
298
298
  </td>
299
299
  </tr>
300
300
 
@@ -374,8 +374,8 @@
374
374
 
375
375
  <tr>
376
376
  <td class="col-md-4">
377
- <div class="io-line">Defined in <a href="" data-line="361"
378
- class="link-to-prism">src/lib/schema-validation.mixin.ts:361</a></div>
377
+ <div class="io-line">Defined in <a href="" data-line="367"
378
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:367</a></div>
379
379
  </td>
380
380
  </tr>
381
381
 
@@ -491,8 +491,8 @@ create a http request. The transformation is guided by the openapi definition</p
491
491
 
492
492
  <tr>
493
493
  <td class="col-md-4">
494
- <div class="io-line">Defined in <a href="" data-line="238"
495
- class="link-to-prism">src/lib/schema-validation.mixin.ts:238</a></div>
494
+ <div class="io-line">Defined in <a href="" data-line="244"
495
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:244</a></div>
496
496
  </td>
497
497
  </tr>
498
498
 
@@ -591,8 +591,8 @@ create a http request. The transformation is guided by the openapi definition</p
591
591
 
592
592
  <tr>
593
593
  <td class="col-md-4">
594
- <div class="io-line">Defined in <a href="" data-line="327"
595
- class="link-to-prism">src/lib/schema-validation.mixin.ts:327</a></div>
594
+ <div class="io-line">Defined in <a href="" data-line="333"
595
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:333</a></div>
596
596
  </td>
597
597
  </tr>
598
598
 
@@ -672,8 +672,8 @@ create a http request. The transformation is guided by the openapi definition</p
672
672
 
673
673
  <tr>
674
674
  <td class="col-md-4">
675
- <div class="io-line">Defined in <a href="" data-line="39"
676
- class="link-to-prism">src/lib/schema-validation.mixin.ts:39</a></div>
675
+ <div class="io-line">Defined in <a href="" data-line="45"
676
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:45</a></div>
677
677
  </td>
678
678
  </tr>
679
679
 
@@ -774,8 +774,8 @@ create a http request. The transformation is guided by the openapi definition</p
774
774
 
775
775
  <tr>
776
776
  <td class="col-md-4">
777
- <div class="io-line">Defined in <a href="" data-line="183"
778
- class="link-to-prism">src/lib/schema-validation.mixin.ts:183</a></div>
777
+ <div class="io-line">Defined in <a href="" data-line="189"
778
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:189</a></div>
779
779
  </td>
780
780
  </tr>
781
781
 
@@ -874,8 +874,8 @@ create a http request. The transformation is guided by the openapi definition</p
874
874
 
875
875
  <tr>
876
876
  <td class="col-md-4">
877
- <div class="io-line">Defined in <a href="" data-line="116"
878
- class="link-to-prism">src/lib/schema-validation.mixin.ts:116</a></div>
877
+ <div class="io-line">Defined in <a href="" data-line="122"
878
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:122</a></div>
879
879
  </td>
880
880
  </tr>
881
881
 
@@ -976,8 +976,8 @@ create a http request. The transformation is guided by the openapi definition</p
976
976
 
977
977
  <tr>
978
978
  <td class="col-md-4">
979
- <div class="io-line">Defined in <a href="" data-line="216"
980
- class="link-to-prism">src/lib/schema-validation.mixin.ts:216</a></div>
979
+ <div class="io-line">Defined in <a href="" data-line="222"
980
+ class="link-to-prism">src/lib/schema-validation.mixin.ts:222</a></div>
981
981
  </td>
982
982
  </tr>
983
983
 
@@ -1069,10 +1069,14 @@ create a http request. The transformation is guided by the openapi definition</p
1069
1069
 
1070
1070
 
1071
1071
  <div class="tab-pane fade tab-source-code" id="source">
1072
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { HttpHeaders, HttpParams } from &#x27;@angular/common/http&#x27;;
1072
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
1073
+ HttpHeaders,
1074
+ HttpParams,
1075
+ } from &#x27;@angular/common/http&#x27;;
1073
1076
  import { isDevMode } from &#x27;@angular/core&#x27;;
1074
1077
  import { HttpRemoteMethodParameter } from &#x27;@rxap/remote-method/http&#x27;;
1075
1078
  import {
1079
+ assertsObject,
1076
1080
  coerceArray,
1077
1081
  isPromiseLike,
1078
1082
  IsRecord,
@@ -1093,6 +1097,8 @@ export interface SchemaValidationResponse&lt;Data&gt; {
1093
1097
  data?: Data;
1094
1098
  }
1095
1099
 
1100
+
1101
+
1096
1102
  export class SchemaValidationMixin&lt;Response &#x3D; any, Parameters extends Record&lt;string, any&gt; | void &#x3D; any, RequestBody &#x3D; any&gt; {
1097
1103
 
1098
1104
  public static STRICT &#x3D; false;
@@ -1461,13 +1467,70 @@ export class SchemaValidationMixin&lt;Response &#x3D; any, Parameters extends Re
1461
1467
  }
1462
1468
 
1463
1469
  if (requestBody !&#x3D;&#x3D; undefined) {
1464
- options.body &#x3D; requestBody;
1470
+ const [ body, contentType ] &#x3D; this.buildBody(operation, requestBody);
1471
+ if (body !&#x3D;&#x3D; undefined) {
1472
+ options.body &#x3D; body;
1473
+ if (contentType !&#x3D;&#x3D; undefined) {
1474
+ options.headers ??&#x3D; new HttpHeaders();
1475
+ options.headers.set(&#x27;Content-Type&#x27;, contentType);
1476
+ }
1477
+ }
1465
1478
  }
1466
1479
 
1467
1480
  return options;
1468
1481
 
1469
1482
  }
1470
1483
 
1484
+ private buildBody(operation: OperationObjectWithMetadata, requestBody: RequestBody): [ any, string | undefined ] {
1485
+ const accept: string[] &#x3D; [];
1486
+ if (operation.requestBody &amp;&amp; !IsReferenceObject(operation.requestBody)) {
1487
+ if (operation.requestBody.content) {
1488
+ for (const contentType of Object.keys(operation.requestBody.content)) {
1489
+ accept.push(contentType);
1490
+ }
1491
+ }
1492
+ }
1493
+ if (!accept.length) {
1494
+ console.warn(&#x27;No content type found for the request body! Omitting the body!&#x27;);
1495
+ return [ undefined, undefined ];
1496
+ }
1497
+ if (accept.length &gt; 1) {
1498
+ console.warn(&#x27;Multiple content types found for the request body! Using the first one!&#x27;);
1499
+ }
1500
+ const contentType &#x3D; accept[0];
1501
+ switch (contentType) {
1502
+
1503
+ case &#x27;application/json&#x27;:
1504
+ assertsObject(requestBody);
1505
+ return [ requestBody, contentType ];
1506
+
1507
+ case &#x27;application/x-www-form-urlencoded&#x27;:
1508
+ assertsObject(requestBody);
1509
+ // eslint-disable-next-line no-case-declarations
1510
+ let params &#x3D; new HttpParams();
1511
+ for (const [ key, value ] of Object.entries(requestBody)) {
1512
+ params &#x3D; params.set(key, value);
1513
+ }
1514
+ return [ params.toString(), contentType ];
1515
+
1516
+ case &#x27;multipart/form-data&#x27;:
1517
+ assertsObject(requestBody);
1518
+ // eslint-disable-next-line no-case-declarations
1519
+ const formData &#x3D; new FormData();
1520
+
1521
+ // Iterate through the JSON object and append each field to FormData
1522
+ for (const [ key, value ] of Object.entries(requestBody)) {
1523
+ formData.append(key, value);
1524
+ }
1525
+ return [ formData, contentType ];
1526
+
1527
+ default:
1528
+ return [ requestBody, contentType ];
1529
+
1530
+ }
1531
+
1532
+ }
1533
+
1471
1534
  private validate(schema: string | boolean | object, value: any): boolean {
1472
1535
 
1473
1536
  if (this.disableSchemaValidation) {
@@ -101,9 +101,9 @@
101
101
  </ol>
102
102
  <ul class="dependencies-list">
103
103
  <li>
104
- <b>@nx/devkit</b> : 19.3.2</li>
104
+ <b>@nx/devkit</b> : 20.2.1</li>
105
105
  <li>
106
- <b>ajv</b> : 8.12.0</li>
106
+ <b>ajv</b> : ^8.12.0</li>
107
107
  <li>
108
108
  <b>openapi-types</b> : ^10.0.0</li>
109
109
  <li>
@@ -117,25 +117,25 @@
117
117
  </ol>
118
118
  <ul class="dependencies-list">
119
119
  <li>
120
- <b>@angular/common</b> : ^18.0.1</li>
120
+ <b>@angular/common</b> : 19.0.3</li>
121
121
  <li>
122
- <b>@angular/core</b> : ^18.0.1</li>
122
+ <b>@angular/core</b> : 19.0.3</li>
123
123
  <li>
124
- <b>@rxap/config</b> : ^18.1.1</li>
124
+ <b>@rxap/config</b> : ^19.0.0-dev.2</li>
125
125
  <li>
126
- <b>@rxap/data-source</b> : ^18.1.1</li>
126
+ <b>@rxap/data-source</b> : ^19.0.0-dev.2</li>
127
127
  <li>
128
- <b>@rxap/environment</b> : ^18.0.3</li>
128
+ <b>@rxap/environment</b> : ^19.0.0-dev.2</li>
129
129
  <li>
130
- <b>@rxap/mixin</b> : ^16.0.6</li>
130
+ <b>@rxap/mixin</b> : ^16.0.11-dev.2</li>
131
131
  <li>
132
- <b>@rxap/remote-method</b> : ^18.0.3</li>
132
+ <b>@rxap/remote-method</b> : ^19.0.0-dev.2</li>
133
133
  <li>
134
- <b>@rxap/rxjs</b> : ^1.1.6</li>
134
+ <b>@rxap/rxjs</b> : ^1.1.11-dev.2</li>
135
135
  <li>
136
- <b>@rxap/utilities</b> : ^16.2.4</li>
136
+ <b>@rxap/utilities</b> : ^16.4.1-dev.2</li>
137
137
  <li>
138
- <b>rxjs</b> : ^7.8.1</li>
138
+ <b>rxjs</b> : 7.8.1</li>
139
139
  </ul>
140
140
 
141
141
 
@@ -99,7 +99,7 @@
99
99
  <h1>Installation</h1>
100
100
  <p><strong>Add the package to your workspace:</strong></p>
101
101
  <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add &#64;rxap/open-api</code></pre></div><p><strong>Install peer dependencies:</strong></p>
102
- <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add &#64;angular/common&#64;^18.0.1 &#64;angular/core&#64;^18.0.1 &#64;rxap/config&#64;^18.1.1 &#64;rxap/data-source&#64;^18.1.1 &#64;rxap/environment&#64;^18.0.3 &#64;rxap/mixin&#64;^16.0.6 &#64;rxap/remote-method&#64;^18.0.3 &#64;rxap/rxjs&#64;^1.1.6 &#64;rxap/utilities&#64;^16.2.4 rxjs&#64;^7.8.1 </code></pre></div><p><strong>Execute the init generator:</strong></p>
102
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add &#64;angular/common&#64;19.0.3 &#64;angular/core&#64;19.0.3 &#64;rxap/config&#64;^19.0.0-dev.2 &#64;rxap/data-source&#64;^19.0.0-dev.2 &#64;rxap/environment&#64;^19.0.0-dev.2 &#64;rxap/mixin&#64;^16.0.11-dev.2 &#64;rxap/remote-method&#64;^19.0.0-dev.2 &#64;rxap/rxjs&#64;^1.1.11-dev.2 &#64;rxap/utilities&#64;^16.4.1-dev.2 rxjs&#64;7.8.1 </code></pre></div><p><strong>Execute the init generator:</strong></p>
103
103
  <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn nx g &#64;rxap/open-api:init</code></pre></div><h1>Generators</h1>
104
104
  <h2>init</h2>
105
105
  <blockquote>
@@ -324,10 +324,14 @@
324
324
 
325
325
 
326
326
  <div class="tab-pane fade tab-source-code" id="source">
327
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { HttpHeaders, HttpParams } from &#x27;@angular/common/http&#x27;;
327
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
328
+ HttpHeaders,
329
+ HttpParams,
330
+ } from &#x27;@angular/common/http&#x27;;
328
331
  import { isDevMode } from &#x27;@angular/core&#x27;;
329
332
  import { HttpRemoteMethodParameter } from &#x27;@rxap/remote-method/http&#x27;;
330
333
  import {
334
+ assertsObject,
331
335
  coerceArray,
332
336
  isPromiseLike,
333
337
  IsRecord,
@@ -348,6 +352,8 @@ export interface SchemaValidationResponse&lt;Data&gt; {
348
352
  data?: Data;
349
353
  }
350
354
 
355
+
356
+
351
357
  export class SchemaValidationMixin&lt;Response &#x3D; any, Parameters extends Record&lt;string, any&gt; | void &#x3D; any, RequestBody &#x3D; any&gt; {
352
358
 
353
359
  public static STRICT &#x3D; false;
@@ -716,13 +722,70 @@ export class SchemaValidationMixin&lt;Response &#x3D; any, Parameters extends Re
716
722
  }
717
723
 
718
724
  if (requestBody !&#x3D;&#x3D; undefined) {
719
- options.body &#x3D; requestBody;
725
+ const [ body, contentType ] &#x3D; this.buildBody(operation, requestBody);
726
+ if (body !&#x3D;&#x3D; undefined) {
727
+ options.body &#x3D; body;
728
+ if (contentType !&#x3D;&#x3D; undefined) {
729
+ options.headers ??&#x3D; new HttpHeaders();
730
+ options.headers.set(&#x27;Content-Type&#x27;, contentType);
731
+ }
732
+ }
720
733
  }
721
734
 
722
735
  return options;
723
736
 
724
737
  }
725
738
 
739
+ private buildBody(operation: OperationObjectWithMetadata, requestBody: RequestBody): [ any, string | undefined ] {
740
+ const accept: string[] &#x3D; [];
741
+ if (operation.requestBody &amp;&amp; !IsReferenceObject(operation.requestBody)) {
742
+ if (operation.requestBody.content) {
743
+ for (const contentType of Object.keys(operation.requestBody.content)) {
744
+ accept.push(contentType);
745
+ }
746
+ }
747
+ }
748
+ if (!accept.length) {
749
+ console.warn(&#x27;No content type found for the request body! Omitting the body!&#x27;);
750
+ return [ undefined, undefined ];
751
+ }
752
+ if (accept.length &gt; 1) {
753
+ console.warn(&#x27;Multiple content types found for the request body! Using the first one!&#x27;);
754
+ }
755
+ const contentType &#x3D; accept[0];
756
+ switch (contentType) {
757
+
758
+ case &#x27;application/json&#x27;:
759
+ assertsObject(requestBody);
760
+ return [ requestBody, contentType ];
761
+
762
+ case &#x27;application/x-www-form-urlencoded&#x27;:
763
+ assertsObject(requestBody);
764
+ // eslint-disable-next-line no-case-declarations
765
+ let params &#x3D; new HttpParams();
766
+ for (const [ key, value ] of Object.entries(requestBody)) {
767
+ params &#x3D; params.set(key, value);
768
+ }
769
+ return [ params.toString(), contentType ];
770
+
771
+ case &#x27;multipart/form-data&#x27;:
772
+ assertsObject(requestBody);
773
+ // eslint-disable-next-line no-case-declarations
774
+ const formData &#x3D; new FormData();
775
+
776
+ // Iterate through the JSON object and append each field to FormData
777
+ for (const [ key, value ] of Object.entries(requestBody)) {
778
+ formData.append(key, value);
779
+ }
780
+ return [ formData, contentType ];
781
+
782
+ default:
783
+ return [ requestBody, contentType ];
784
+
785
+ }
786
+
787
+ }
788
+
726
789
  private validate(schema: string | boolean | object, value: any): boolean {
727
790
 
728
791
  if (this.disableSchemaValidation) {
@@ -37,4 +37,4 @@ customElements.define('compodoc-menu', /*#__PURE__*/function (_HTMLElement) {
37
37
  this.innerHTML = tp.strings;
38
38
  }
39
39
  }]);
40
- }( /*#__PURE__*/_wrapNativeSuper(HTMLElement)));
40
+ }(/*#__PURE__*/_wrapNativeSuper(HTMLElement)));