Skip to content

Commit 6ba2633

Browse files
authored
chore(deps): upgrading @apidevtools/json-scheam-ref-parser (#988)
## 🧰 Changes This upgrade `@apidevtools/json-schema-ref-parser` to the latest release and also adds a test for the problem that was surfaced in readmeio/rdme#1306 and fixed in APIDevTools/json-schema-ref-parser#393. Since this upgrade had to be reverted earlier today due to it being released in a patch release, which was automatically pulled down to all existing rdme versions, since this is a major version bump of `json-schema-ref-parser` I'll do a major version bump of our parser library too. Better safe than sorry.
1 parent b036a75 commit 6ba2633

File tree

4 files changed

+94
-21
lines changed

4 files changed

+94
-21
lines changed

package-lock.json

Lines changed: 18 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"test": "echo 'Please run tests from the root!' && exit 1"
5959
},
6060
"dependencies": {
61-
"@apidevtools/json-schema-ref-parser": "^13.0.5",
61+
"@apidevtools/json-schema-ref-parser": "^14.1.1",
6262
"@readme/better-ajv-errors": "^2.3.2",
6363
"@readme/openapi-schemas": "^3.1.0",
6464
"@types/json-schema": "^7.0.15",
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { describe, it, expect } from 'vitest';
2+
3+
import { bundle } from '../../../src/index.js';
4+
import { relativePath } from '../../utils.js';
5+
6+
describe('bundle', () => {
7+
it('should bundle successfully', async () => {
8+
const api = await bundle(relativePath('specs/bundling/nullish-example.yaml'));
9+
10+
expect(api).toStrictEqual({
11+
openapi: '3.0.3',
12+
info: {
13+
version: '1.0',
14+
title: 'API definition with a nullish example property',
15+
},
16+
paths: {
17+
'/anything': {
18+
get: {
19+
responses: {
20+
'200': {
21+
description: 'OK',
22+
content: {
23+
'application/json': {
24+
schema: {
25+
type: 'array',
26+
items: { $ref: '#/components/schemas/User-Information' },
27+
},
28+
example: { data: { first: null, last: 'lastname' } },
29+
},
30+
},
31+
},
32+
},
33+
},
34+
},
35+
},
36+
components: {
37+
schemas: {
38+
'User-Information': {
39+
type: 'object',
40+
properties: { first: { type: 'boolean' }, last: { type: 'boolean' } },
41+
},
42+
},
43+
},
44+
});
45+
});
46+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
openapi: 3.0.3
2+
info:
3+
version: '1.0'
4+
title: API definition with a nullish example property
5+
paths:
6+
/anything:
7+
get:
8+
responses:
9+
'200':
10+
description: OK
11+
content:
12+
application/json:
13+
schema:
14+
type: array
15+
items:
16+
'$ref': '#/components/schemas/User-Information'
17+
example:
18+
data:
19+
first:
20+
last: lastname
21+
components:
22+
schemas:
23+
User-Information:
24+
type: object
25+
properties:
26+
first:
27+
type: boolean
28+
last:
29+
type: boolean

0 commit comments

Comments
 (0)