Skip to content

Commit 0fda257

Browse files
authored
Fix types (#520)
* Fix types * Use ci in GitHub Actions
1 parent db0df34 commit 0fda257

File tree

14 files changed

+30
-21
lines changed

14 files changed

+30
-21
lines changed

.github/workflows/merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ jobs:
88
steps:
99
- uses: actions/checkout@v2
1010
- uses: actions/setup-node@v1
11-
- run: npm install
11+
- run: npm ci
1212
- run: npm run build

.github/workflows/pull_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
steps:
99
- uses: actions/checkout@v2
1010
- uses: actions/setup-node@v1
11-
- run: npm install
11+
- run: npm ci
1212
- run: npm run build
1313
lint:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-node@v1
18-
- run: npm install
18+
- run: npm ci
1919
- run: npm run lint
2020
test:
2121
runs-on: ubuntu-latest
@@ -25,12 +25,12 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v2
2727
- uses: actions/setup-node@v1
28-
- run: npm install
28+
- run: npm ci
2929
- run: npm run test:coverage
3030
typecheck:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- uses: actions/checkout@v2
3434
- uses: actions/setup-node@v1
35-
- run: npm install
35+
- run: npm ci
3636
- run: npm run typecheck

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"src",
2424
"types"
2525
],
26-
"types": "./types/index.d.ts",
2726
"repository": {
2827
"type": "git",
2928
"url": "https://github.com/drwpow/openapi-typescript"

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import path from "path";
22
import prettier from "prettier";
33
import { swaggerVersion } from "./utils";
44
import { transformAll } from "./transform/index";
5+
import { OpenAPI2, OpenAPI3, SchemaObject, SwaggerToTSOptions } from "./types";
6+
export * from "./types"; // expose all types to consumers
57

68
export const WARNING_MESSAGE = `/**
79
* This file was auto-generated by openapi-typescript.

src/transform/headers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { HeaderObject } from "../types";
12
import { comment } from "../utils";
23
import { transformSchemaObj } from "./schema";
34

src/transform/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { OperationObject } from "../types";
12
import { comment } from "../utils";
23
import { transformHeaderObjMap } from "./headers";
34
import { transformOperationObj } from "./operation";

src/transform/operation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { OperationObject, ParameterObject, RequestBody } from "../types";
12
import { comment, isRef, transformRef } from "../utils";
23
import { transformParametersArray } from "./parameters";
34
import { transformResponsesObj } from "./responses";

src/transform/parameters.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { transformSchemaObj } from "./schema";
1+
import { ParameterObject, ReferenceObject } from "../types";
22
import { comment } from "../utils";
3+
import { transformSchemaObj } from "./schema";
34

45
export function transformParametersArray(
56
parameters: (ReferenceObject | ParameterObject)[],

src/transform/paths.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { OperationObject, ParameterObject, PathItemObject } from "../types";
12
import { comment, transformRef } from "../utils";
23
import { transformOperationObj } from "./operation";
34
import { transformParametersArray } from "./parameters";

src/transform/responses.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { RequestBody } from "../types";
12
import { comment, transformRef } from "../utils";
23
import { transformHeaderObjMap } from "./headers";
34
import { transformSchemaObj } from "./schema";

0 commit comments

Comments
 (0)