@twin.org/ts-to-openapi 0.0.2-next.7 → 0.0.2-next.9
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/dist/cjs/index.cjs +4 -3
- package/dist/esm/index.mjs +4 -3
- package/docs/changelog.md +28 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -438,12 +438,13 @@ async function tsToOpenApi(config, outputFile, workingDirectory) {
|
|
|
438
438
|
if (requestObject?.properties) {
|
|
439
439
|
// If there are any properties other than body, query, pathParams and headers
|
|
440
440
|
// we should throw an error as we don't know what to do with them
|
|
441
|
-
const otherKeys = Object.keys(requestObject.properties).filter(k => !["body", "query", "pathParams", "headers"].includes(k));
|
|
441
|
+
const otherKeys = Object.keys(requestObject.properties).filter(k => !["body", "query", "pathParams", "headers", "authentication"].includes(k));
|
|
442
442
|
if (otherKeys.length > 0) {
|
|
443
443
|
throw new core.GeneralError("commands", "commands.ts-to-openapi.unsupportedProperties", {
|
|
444
444
|
keys: otherKeys.join(", ")
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
+
delete requestObject.properties.authentication;
|
|
447
448
|
// If there is a path params object convert these to params
|
|
448
449
|
if (core.Is.object(requestObject.properties.pathParams)) {
|
|
449
450
|
for (const pathParam of pathQueryHeaderParams) {
|
|
@@ -656,7 +657,7 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
656
657
|
// We can remove any auto expand types from the final schema as they
|
|
657
658
|
// will have been expanded inline so no need to keep them
|
|
658
659
|
for (const autoExpandType of autoExpandTypes) {
|
|
659
|
-
const regExp = toolsCore.JsonSchemaHelper.
|
|
660
|
+
const regExp = toolsCore.JsonSchemaHelper.stringToRegEx(autoExpandType);
|
|
660
661
|
if (regExp.test(schema)) {
|
|
661
662
|
skipSchema = true;
|
|
662
663
|
break;
|
|
@@ -1062,7 +1063,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
1062
1063
|
return this.execute({
|
|
1063
1064
|
title: "TWIN TypeScript To OpenAPI",
|
|
1064
1065
|
appName: "ts-to-openapi",
|
|
1065
|
-
version: "0.0.2-next.
|
|
1066
|
+
version: "0.0.2-next.9", // x-release-please-version
|
|
1066
1067
|
icon: "⚙️ ",
|
|
1067
1068
|
supportsEnvFiles: false,
|
|
1068
1069
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/esm/index.mjs
CHANGED
|
@@ -435,12 +435,13 @@ async function tsToOpenApi(config, outputFile, workingDirectory) {
|
|
|
435
435
|
if (requestObject?.properties) {
|
|
436
436
|
// If there are any properties other than body, query, pathParams and headers
|
|
437
437
|
// we should throw an error as we don't know what to do with them
|
|
438
|
-
const otherKeys = Object.keys(requestObject.properties).filter(k => !["body", "query", "pathParams", "headers"].includes(k));
|
|
438
|
+
const otherKeys = Object.keys(requestObject.properties).filter(k => !["body", "query", "pathParams", "headers", "authentication"].includes(k));
|
|
439
439
|
if (otherKeys.length > 0) {
|
|
440
440
|
throw new GeneralError("commands", "commands.ts-to-openapi.unsupportedProperties", {
|
|
441
441
|
keys: otherKeys.join(", ")
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
|
+
delete requestObject.properties.authentication;
|
|
444
445
|
// If there is a path params object convert these to params
|
|
445
446
|
if (Is.object(requestObject.properties.pathParams)) {
|
|
446
447
|
for (const pathParam of pathQueryHeaderParams) {
|
|
@@ -653,7 +654,7 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
653
654
|
// We can remove any auto expand types from the final schema as they
|
|
654
655
|
// will have been expanded inline so no need to keep them
|
|
655
656
|
for (const autoExpandType of autoExpandTypes) {
|
|
656
|
-
const regExp = JsonSchemaHelper.
|
|
657
|
+
const regExp = JsonSchemaHelper.stringToRegEx(autoExpandType);
|
|
657
658
|
if (regExp.test(schema)) {
|
|
658
659
|
skipSchema = true;
|
|
659
660
|
break;
|
|
@@ -1059,7 +1060,7 @@ class CLI extends CLIBase {
|
|
|
1059
1060
|
return this.execute({
|
|
1060
1061
|
title: "TWIN TypeScript To OpenAPI",
|
|
1061
1062
|
appName: "ts-to-openapi",
|
|
1062
|
-
version: "0.0.2-next.
|
|
1063
|
+
version: "0.0.2-next.9", // x-release-please-version
|
|
1063
1064
|
icon: "⚙️ ",
|
|
1064
1065
|
supportsEnvFiles: false,
|
|
1065
1066
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @twin.org/ts-to-openapi - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.9](https://github.com/twinfoundation/tools/compare/ts-to-openapi-v0.0.2-next.8...ts-to-openapi-v0.0.2-next.9) (2025-09-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add support for authentication property ([ba002c2](https://github.com/twinfoundation/tools/commit/ba002c2c641618ffe7664269179bca6e9fbc9655))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/tools-core bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
16
|
+
|
|
17
|
+
## [0.0.2-next.8](https://github.com/twinfoundation/tools/compare/ts-to-openapi-v0.0.2-next.7...ts-to-openapi-v0.0.2-next.8) (2025-09-05)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* tighten the types included with the regex matching ([e54909b](https://github.com/twinfoundation/tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/tools-core bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
30
|
+
|
|
3
31
|
## [0.0.2-next.7](https://github.com/twinfoundation/tools/compare/ts-to-openapi-v0.0.2-next.6...ts-to-openapi-v0.0.2-next.7) (2025-08-29)
|
|
4
32
|
|
|
5
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/ts-to-openapi",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.9",
|
|
4
4
|
"description": "Tool to convert TypeScript REST route definitions to OpenAPI Specifications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@twin.org/cli-core": "next",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
|
-
"@twin.org/tools-core": "0.0.2-next.
|
|
21
|
+
"@twin.org/tools-core": "0.0.2-next.9",
|
|
22
22
|
"@twin.org/web": "next",
|
|
23
23
|
"commander": "14.0.0",
|
|
24
24
|
"glob": "11.0.3",
|