Skip to content

Commit 6905eee

Browse files
authored
bump oas3 and the result being upgraded ajv lib (#138)
changeset fix github action bump typescript version
1 parent aae8267 commit 6905eee

File tree

8 files changed

+920
-351
lines changed

8 files changed

+920
-351
lines changed

.changeset/clean-colts-jam.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"koa-oas3": major
3+
---
4+
5+
Bumped oas3-chow-chow which has an upgraded ajv version.
6+
* The latest ajv version has removed the support for JSON Schema Draft-v4 and the result being that you might see some warning about your schema syntax which you need fix.
7+
8+
Remove Node v14 support

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
node-version: [14.x, 16.x]
13+
node-version: [16.x, 18.x]
1414

1515
steps:
1616
- uses: actions/checkout@v2

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout Repo
14-
uses: actions/checkout@master
14+
uses: actions/checkout@v2
1515
with:
1616
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1717
fetch-depth: 0
1818

1919

20-
- name: Setup Node.js 12.x
21-
uses: actions/setup-node@master
20+
- name: Setup Node.js 16.x
21+
uses: actions/setup-node@v2
2222
with:
23-
node-version: 12.x
23+
node-version: 16.x
2424

2525
- name: Install Dependencies
26-
run: yarn
26+
run: yarn install --frozen-lockfile
2727

2828
- name: Create Release Pull Request or Publish to npm
29-
uses: changesets/action@master
29+
uses: changesets/action@v1
3030
with:
3131
# this expects you to have a script called release which does a build for your packages and calls changeset publish
3232
publish: yarn release
3333
env:
34-
GITHUB_TOKEN: ${{ secrets.RELEASE_ACTION_TOKEN }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

__tests__/fixtures/pet-store.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
"components": {
302302
"schemas": {
303303
"Pet": {
304+
"type": "object",
304305
"required": [
305306
"id",
306307
"name"
@@ -325,6 +326,7 @@
325326
}
326327
},
327328
"Error": {
329+
"type": "object",
328330
"required": [
329331
"code",
330332
"message"

__tests__/index.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ describe('Koa Oas3 with ChowOptions', () => {
419419
});
420420
const next = jest.fn();
421421
await mw(ctx, next);
422-
console.log(`ctx.oas: ${JSON.stringify(ctx.oas)}`)
423422
expect(ctx.oas!.request.params.petId).toBe(pathParam);
424423
});
425424

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"koa-bodyparser": "^4.2.1",
3333
"koa-compose": "^4.1.0",
3434
"oas-validator": "^5.0.3",
35-
"oas3-chow-chow": "^2.0.0",
35+
"oas3-chow-chow": "^3.0.0",
3636
"qs": "^6.9.1"
3737
},
3838
"devDependencies": {
39-
"@changesets/cli": "2.16.0",
39+
"@changesets/cli": "2.26.2",
4040
"@types/jest": "27.0.1",
4141
"@types/js-yaml": "3.12.6",
4242
"@types/jsonfile": "5.0.2",
@@ -47,7 +47,7 @@
4747
"koa": "2.11.0",
4848
"node-mocks-http": "1.10.1",
4949
"ts-jest": "24.3.0",
50-
"typescript": "3.9.10"
50+
"typescript": "5.2.2"
5151
},
5252
"peerDependencies": {
5353
"koa": "2"

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async function compileOas(config: Config) {
147147
}
148148

149149
return {
150-
compiled: new ChowChow(openApiObject, config.validationOptions),
150+
compiled: await ChowChow.create(openApiObject, config.validationOptions),
151151
doc: openApiObject,
152152
};
153153
}

0 commit comments

Comments
 (0)