Skip to content

Commit d129d2b

Browse files
committed
fix: stricter openapi 2.0 type
1 parent 2bc3eee commit d129d2b

6 files changed

Lines changed: 32 additions & 6 deletions

File tree

.changeset/short-walls-battle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/spec-types": patch
3+
---
4+
5+
**openapi**: fix: stricter 2.0 version type

packages/spec-types/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737
],
3838
"type": "module",
3939
"sideEffects": false,
40-
"types": "./dist/index.d.ts",
40+
"types": "./dist/index.d.mts",
4141
"exports": {
4242
".": {
43-
"types": "./dist/index.d.ts"
43+
"types": "./dist/index.d.mts"
4444
},
4545
"./package.json": "./package.json"
4646
},
4747
"scripts": {
48-
"build": "tsc --build",
49-
"dev": "tsc --build --watch",
48+
"build": "tsdown",
49+
"dev": "tsdown --watch",
5050
"prepublishOnly": "pnpm build",
5151
"typecheck": "tsgo --noEmit"
5252
},

packages/spec-types/src/openapi/v2/spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export interface Document {
6565
/**
6666
* **Required**. Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be `"2.0"`.
6767
*/
68-
swagger: string;
68+
swagger: '2.0';
6969
/**
7070
* A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#operation-object Operation Object} must be declared. The tags that are not declared may be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
7171
*/

packages/spec-types/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"outDir": "dist",
77
"rootDir": "src"
88
},
9-
"include": ["src"]
9+
"include": ["src"],
10+
"references": [{ "path": "../types" }]
1011
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'tsdown';
2+
3+
export default defineConfig({
4+
attw: {
5+
ignoreRules: ['cjs-resolves-to-esm'],
6+
profile: 'esm-only',
7+
},
8+
publint: true,
9+
sourcemap: true,
10+
});

packages/spec-types/turbo.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../node_modules/turbo/schema.json",
3+
"extends": ["//"],
4+
"tasks": {
5+
"build": {
6+
"dependsOn": [],
7+
"outputs": ["dist/**"]
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)