@rxap/open-api 19.2.0-dev.2 → 19.2.0-dev.4
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.
- package/CHANGELOG.md +10 -0
- package/compodoc/changelog.html +7 -0
- package/compodoc/classes/SchemaValidationMixin.html +106 -6
- package/compodoc/dependencies.html +1 -1
- package/compodoc/interfaces/SchemaValidationResponse.html +19 -4
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +295 -216
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/OpenApiConfigService.html +3 -3
- package/docs/html/classes/OpenApiHttpResponseError.html +8 -8
- package/docs/html/classes/RxapOpenApiError.html +5 -5
- package/docs/html/classes/SchemaValidationMixin.html +6 -5
- package/docs/html/functions/AssertOpenApiV3.html +1 -1
- package/docs/html/functions/IsOpenApiV3.html +1 -1
- package/docs/html/functions/IsReferenceObject.html +1 -1
- package/docs/html/functions/NotContainsReferenceObjects.html +1 -1
- package/docs/html/functions/OpenApiInit.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/OpenApiInitOptions.html +3 -3
- package/docs/html/interfaces/OpenApiMetaData.html +5 -5
- package/docs/html/interfaces/OperationObjectWithMetadata.html +2 -2
- package/docs/html/interfaces/SchemaValidationResponse.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/OperationMap.html +1 -1
- package/docs/html/variables/DEFAULT_OPEN_API_DATA_SOURCE_META_DATA.html +1 -1
- package/docs/html/variables/DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA.html +1 -1
- package/docs/html/variables/DISABLE_SCHEMA_VALIDATION.html +1 -1
- package/docs/html/variables/DISABLE_VALIDATION.html +1 -1
- package/docs/html/variables/RXAP_OPEN_API_CONFIG.html +1 -1
- package/docs/html/variables/RXAP_OPEN_API_STRICT_VALIDATOR.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/OpenApiConfigService.md +14 -14
- package/docs/markdown/classes/OpenApiHttpResponseError.md +16 -16
- package/docs/markdown/classes/RxapOpenApiError.md +13 -13
- package/docs/markdown/classes/SchemaValidationMixin.md +34 -12
- package/docs/markdown/functions/AssertOpenApiV3.md +2 -2
- package/docs/markdown/functions/IsOpenApiV3.md +2 -2
- package/docs/markdown/functions/IsReferenceObject.md +2 -2
- package/docs/markdown/functions/NotContainsReferenceObjects.md +2 -2
- package/docs/markdown/functions/OpenApiInit.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/OpenApiInitOptions.md +4 -4
- package/docs/markdown/interfaces/OpenApiMetaData.md +8 -8
- package/docs/markdown/interfaces/OperationObjectWithMetadata.md +4 -4
- package/docs/markdown/interfaces/SchemaValidationResponse.md +6 -6
- package/docs/markdown/type-aliases/OperationMap.md +2 -2
- package/docs/markdown/variables/DEFAULT_OPEN_API_DATA_SOURCE_META_DATA.md +2 -2
- package/docs/markdown/variables/DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA.md +2 -2
- package/docs/markdown/variables/DISABLE_SCHEMA_VALIDATION.md +2 -2
- package/docs/markdown/variables/DISABLE_VALIDATION.md +2 -2
- package/docs/markdown/variables/RXAP_OPEN_API_CONFIG.md +2 -2
- package/docs/markdown/variables/RXAP_OPEN_API_STRICT_VALIDATOR.md +2 -2
- package/docs/wiki/Class.OpenApiConfigService.md +13 -13
- package/docs/wiki/Class.OpenApiHttpResponseError.md +15 -15
- package/docs/wiki/Class.RxapOpenApiError.md +12 -12
- package/docs/wiki/Class.SchemaValidationMixin.md +33 -11
- package/docs/wiki/Function.AssertOpenApiV3.md +1 -1
- package/docs/wiki/Function.IsOpenApiV3.md +1 -1
- package/docs/wiki/Function.IsReferenceObject.md +1 -1
- package/docs/wiki/Function.NotContainsReferenceObjects.md +1 -1
- package/docs/wiki/Function.OpenApiInit.md +1 -1
- package/docs/wiki/Interface.OpenApiInitOptions.md +3 -3
- package/docs/wiki/Interface.OpenApiMetaData.md +7 -7
- package/docs/wiki/Interface.OperationObjectWithMetadata.md +3 -3
- package/docs/wiki/Interface.SchemaValidationResponse.md +5 -5
- package/docs/wiki/TypeAlias.OperationMap.md +1 -1
- package/docs/wiki/Variable.DEFAULT_OPEN_API_DATA_SOURCE_META_DATA.md +1 -1
- package/docs/wiki/Variable.DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA.md +1 -1
- package/docs/wiki/Variable.DISABLE_SCHEMA_VALIDATION.md +1 -1
- package/docs/wiki/Variable.DISABLE_VALIDATION.md +1 -1
- package/docs/wiki/Variable.RXAP_OPEN_API_CONFIG.md +1 -1
- package/docs/wiki/Variable.RXAP_OPEN_API_STRICT_VALIDATOR.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-open-api-data-source-table.mjs +10 -10
- package/fesm2022/rxap-open-api-data-source-table.mjs.map +1 -1
- package/fesm2022/rxap-open-api-data-source.mjs +6 -6
- package/fesm2022/rxap-open-api-data-source.mjs.map +1 -1
- package/fesm2022/rxap-open-api-http-resource.mjs +13 -1
- package/fesm2022/rxap-open-api-http-resource.mjs.map +1 -1
- package/fesm2022/rxap-open-api-remote-method.mjs +6 -6
- package/fesm2022/rxap-open-api-remote-method.mjs.map +1 -1
- package/fesm2022/rxap-open-api.mjs +23 -7
- package/fesm2022/rxap-open-api.mjs.map +1 -1
- package/http-resource/index.d.ts +1 -0
- package/http-resource/lib/to-http-headers.d.ts +3 -0
- package/lib/schema-validation.mixin.d.ts +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.2.0-dev.4](https://gitlab.com/rxap/packages/compare/@rxap/open-api@19.2.0-dev.3...@rxap/open-api@19.2.0-dev.4) (2025-12-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rxap/open-api
|
|
9
|
+
|
|
10
|
+
# [19.2.0-dev.3](https://gitlab.com/rxap/packages/compare/@rxap/open-api@19.2.0-dev.2...@rxap/open-api@19.2.0-dev.3) (2025-10-13)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **schema-validation:** improve path parameter handling and validation ([9b06d23](https://gitlab.com/rxap/packages/commit/9b06d2355eb2a50383bd17325b8c213be8890ade))
|
|
15
|
+
|
|
6
16
|
# [19.2.0-dev.2](https://gitlab.com/rxap/packages/compare/@rxap/open-api@19.2.0-dev.1...@rxap/open-api@19.2.0-dev.2) (2025-09-23)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/compodoc/changelog.html
CHANGED
|
@@ -85,6 +85,13 @@
|
|
|
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.2.0-dev.3...@rxap/open-api@19.2.0-dev.4">19.2.0-dev.4</a> (2025-12-08)</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@19.2.0-dev.2...@rxap/open-api@19.2.0-dev.3">19.2.0-dev.3</a> (2025-10-13)</h1>
|
|
91
|
+
<h3>Bug Fixes</h3>
|
|
92
|
+
<ul>
|
|
93
|
+
<li><strong>schema-validation:</strong> improve path parameter handling and validation (<a href="https://gitlab.com/rxap/packages/commit/9b06d2355eb2a50383bd17325b8c213be8890ade">9b06d23</a>)</li>
|
|
94
|
+
</ul>
|
|
88
95
|
<h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/open-api@19.2.0-dev.1...@rxap/open-api@19.2.0-dev.2">19.2.0-dev.2</a> (2025-09-23)</h1>
|
|
89
96
|
<h3>Features</h3>
|
|
90
97
|
<ul>
|
|
@@ -176,6 +176,10 @@
|
|
|
176
176
|
<span class="modifier">Public</span>
|
|
177
177
|
<a href="#buildHttpPathParams" >buildHttpPathParams</a>
|
|
178
178
|
</li>
|
|
179
|
+
<li>
|
|
180
|
+
<span class="modifier">Protected</span>
|
|
181
|
+
<a href="#normalizePathParamValue" >normalizePathParamValue</a>
|
|
182
|
+
</li>
|
|
179
183
|
<li>
|
|
180
184
|
<span class="modifier">Public</span>
|
|
181
185
|
<a href="#validateParameters" >validateParameters</a>
|
|
@@ -374,8 +378,8 @@
|
|
|
374
378
|
|
|
375
379
|
<tr>
|
|
376
380
|
<td class="col-md-4">
|
|
377
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
378
|
-
class="link-to-prism">src/lib/schema-validation.mixin.ts:
|
|
381
|
+
<div class="io-line">Defined in <a href="" data-line="377"
|
|
382
|
+
class="link-to-prism">src/lib/schema-validation.mixin.ts:377</a></div>
|
|
379
383
|
</td>
|
|
380
384
|
</tr>
|
|
381
385
|
|
|
@@ -650,6 +654,87 @@ create a http request. The transformation is guided by the openapi definition</p
|
|
|
650
654
|
</tr>
|
|
651
655
|
</tbody>
|
|
652
656
|
</table>
|
|
657
|
+
<table class="table table-sm table-bordered">
|
|
658
|
+
<tbody>
|
|
659
|
+
<tr>
|
|
660
|
+
<td class="col-md-4">
|
|
661
|
+
<a name="normalizePathParamValue"></a>
|
|
662
|
+
<span class="name">
|
|
663
|
+
<span class="modifier">Protected</span>
|
|
664
|
+
<span ><b>normalizePathParamValue</b></span>
|
|
665
|
+
<a href="#normalizePathParamValue"><span class="icon ion-ios-link"></span></a>
|
|
666
|
+
</span>
|
|
667
|
+
</td>
|
|
668
|
+
</tr>
|
|
669
|
+
<tr>
|
|
670
|
+
<td class="col-md-4">
|
|
671
|
+
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
672
|
+
<code>normalizePathParamValue(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, paramName: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
673
|
+
</td>
|
|
674
|
+
</tr>
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
<tr>
|
|
678
|
+
<td class="col-md-4">
|
|
679
|
+
<div class="io-line">Defined in <a href="" data-line="351"
|
|
680
|
+
class="link-to-prism">src/lib/schema-validation.mixin.ts:351</a></div>
|
|
681
|
+
</td>
|
|
682
|
+
</tr>
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
<tr>
|
|
686
|
+
<td class="col-md-4">
|
|
687
|
+
|
|
688
|
+
<div class="io-description">
|
|
689
|
+
<b>Parameters :</b>
|
|
690
|
+
|
|
691
|
+
<table class="params">
|
|
692
|
+
<thead>
|
|
693
|
+
<tr>
|
|
694
|
+
<td>Name</td>
|
|
695
|
+
<td>Type</td>
|
|
696
|
+
<td>Optional</td>
|
|
697
|
+
</tr>
|
|
698
|
+
</thead>
|
|
699
|
+
<tbody>
|
|
700
|
+
<tr>
|
|
701
|
+
<td>value</td>
|
|
702
|
+
<td>
|
|
703
|
+
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
704
|
+
</td>
|
|
705
|
+
|
|
706
|
+
<td>
|
|
707
|
+
No
|
|
708
|
+
</td>
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
</tr>
|
|
712
|
+
<tr>
|
|
713
|
+
<td>paramName</td>
|
|
714
|
+
<td>
|
|
715
|
+
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
716
|
+
</td>
|
|
717
|
+
|
|
718
|
+
<td>
|
|
719
|
+
No
|
|
720
|
+
</td>
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
</tr>
|
|
724
|
+
</tbody>
|
|
725
|
+
</table>
|
|
726
|
+
</div>
|
|
727
|
+
<div class="io-description">
|
|
728
|
+
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
729
|
+
|
|
730
|
+
</div>
|
|
731
|
+
<div class="io-description">
|
|
732
|
+
|
|
733
|
+
</div>
|
|
734
|
+
</td>
|
|
735
|
+
</tr>
|
|
736
|
+
</tbody>
|
|
737
|
+
</table>
|
|
653
738
|
<table class="table table-sm table-bordered">
|
|
654
739
|
<tbody>
|
|
655
740
|
<tr>
|
|
@@ -1407,10 +1492,8 @@ export class SchemaValidationMixin<Response = any, Parameters extends Re
|
|
|
1407
1492
|
|
|
1408
1493
|
for (const parameter of operationParameters.filter(p => p.in === 'path')) {
|
|
1409
1494
|
|
|
1410
|
-
if (
|
|
1411
|
-
pathParams[parameter.name] =
|
|
1412
|
-
JSON.stringify(parameters[parameter.name]) :
|
|
1413
|
-
parameters[parameter.name]);
|
|
1495
|
+
if (parameter.name in parameters) {
|
|
1496
|
+
pathParams[parameter.name] = this.normalizePathParamValue(parameters[parameter.name], parameter.name);
|
|
1414
1497
|
}
|
|
1415
1498
|
|
|
1416
1499
|
}
|
|
@@ -1421,6 +1504,23 @@ export class SchemaValidationMixin<Response = any, Parameters extends Re
|
|
|
1421
1504
|
|
|
1422
1505
|
}
|
|
1423
1506
|
|
|
1507
|
+
protected normalizePathParamValue(value: any, paramName: string): string {
|
|
1508
|
+
if (!value) {
|
|
1509
|
+
throw new Error(`The path parameter '${paramName}' is empty or undefined!`);
|
|
1510
|
+
}
|
|
1511
|
+
if (Array.isArray(value)) {
|
|
1512
|
+
if (value.length === 0) {
|
|
1513
|
+
throw new Error(`The path parameter '${paramName}' is an empty array!`);
|
|
1514
|
+
}
|
|
1515
|
+
return value.map((item, index) => this.normalizePathParamValue(item, `${ paramName }[${index}]`)).join('/');
|
|
1516
|
+
} else if (typeof value === 'object') {
|
|
1517
|
+
return encodeURIComponent(JSON.stringify(value));
|
|
1518
|
+
} else if (typeof value === `string`) {
|
|
1519
|
+
return encodeURIComponent(value);
|
|
1520
|
+
}
|
|
1521
|
+
return value.toString();
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1424
1524
|
/**
|
|
1425
1525
|
* Converts open api parameters into the corresponding http options to
|
|
1426
1526
|
* create a http request. The transformation is guided by the openapi definition
|
|
@@ -662,10 +662,8 @@ export class SchemaValidationMixin<Response = any, Parameters extends Re
|
|
|
662
662
|
|
|
663
663
|
for (const parameter of operationParameters.filter(p => p.in === 'path')) {
|
|
664
664
|
|
|
665
|
-
if (
|
|
666
|
-
pathParams[parameter.name] =
|
|
667
|
-
JSON.stringify(parameters[parameter.name]) :
|
|
668
|
-
parameters[parameter.name]);
|
|
665
|
+
if (parameter.name in parameters) {
|
|
666
|
+
pathParams[parameter.name] = this.normalizePathParamValue(parameters[parameter.name], parameter.name);
|
|
669
667
|
}
|
|
670
668
|
|
|
671
669
|
}
|
|
@@ -676,6 +674,23 @@ export class SchemaValidationMixin<Response = any, Parameters extends Re
|
|
|
676
674
|
|
|
677
675
|
}
|
|
678
676
|
|
|
677
|
+
protected normalizePathParamValue(value: any, paramName: string): string {
|
|
678
|
+
if (!value) {
|
|
679
|
+
throw new Error(`The path parameter '${paramName}' is empty or undefined!`);
|
|
680
|
+
}
|
|
681
|
+
if (Array.isArray(value)) {
|
|
682
|
+
if (value.length === 0) {
|
|
683
|
+
throw new Error(`The path parameter '${paramName}' is an empty array!`);
|
|
684
|
+
}
|
|
685
|
+
return value.map((item, index) => this.normalizePathParamValue(item, `${ paramName }[${index}]`)).join('/');
|
|
686
|
+
} else if (typeof value === 'object') {
|
|
687
|
+
return encodeURIComponent(JSON.stringify(value));
|
|
688
|
+
} else if (typeof value === `string`) {
|
|
689
|
+
return encodeURIComponent(value);
|
|
690
|
+
}
|
|
691
|
+
return value.toString();
|
|
692
|
+
}
|
|
693
|
+
|
|
679
694
|
/**
|
|
680
695
|
* Converts open api parameters into the corresponding http options to
|
|
681
696
|
* create a http request. The transformation is guided by the openapi definition
|