Skip to content

Commit 7eebc75

Browse files
committed
fix(deps): bump @stoplight/json-schema-merge-allof to ^0.7.1
1 parent f6b2b11 commit 7eebc75

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"dependencies": {
4545
"@stoplight/json": "^3.5.1",
46-
"@stoplight/json-schema-merge-allof": "^0.7.0",
46+
"@stoplight/json-schema-merge-allof": "^0.7.1",
4747
"@stoplight/react-error-boundary": "^1.0.0",
4848
"@stoplight/tree-list": "^5.0.0",
4949
"classnames": "^2.2.6",

src/tree/utils/__tests__/mergeAllOf.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('mergeAllOf util', () => {
2727
],
2828
};
2929

30-
expect(mergeAllOf(schema, [], jest.fn())).toEqual({
30+
expect(mergeAllOf(schema, [], {} as any)).toEqual({
3131
properties: {
3232
bar: {
3333
example: null,
@@ -62,7 +62,7 @@ describe('mergeAllOf util', () => {
6262
],
6363
};
6464

65-
expect(mergeAllOf(schema, [], jest.fn())).toEqual({
65+
expect(mergeAllOf(schema, [], {} as any)).toEqual({
6666
properties: {
6767
bar: {
6868
example: 'hello',
@@ -99,7 +99,7 @@ describe('mergeAllOf util', () => {
9999
],
100100
};
101101

102-
expect(mergeAllOf(schema, [], jest.fn())).toEqual({
102+
expect(mergeAllOf(schema, [], {} as any)).toEqual({
103103
properties: {
104104
bar: {
105105
enum: [],
@@ -134,7 +134,7 @@ describe('mergeAllOf util', () => {
134134
],
135135
};
136136

137-
expect(mergeAllOf(schema, [], jest.fn())).toEqual({
137+
expect(mergeAllOf(schema, [], {} as any)).toEqual({
138138
properties: {
139139
bar: {
140140
enum: ['jonas', 'frederik'],

src/tree/utils/mergeAllOf.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { pathToPointer } from '@stoplight/json';
22
import { JsonPath } from '@stoplight/types';
33
import { JSONSchema4 } from 'json-schema';
4-
import { cloneDeep, compact } from 'lodash';
4+
import { cloneDeep } from 'lodash';
55
import { ResolvingError } from '../../errors';
66
import { WalkingOptions } from './populateTree';
77

@@ -12,24 +12,7 @@ const store = new WeakMap<WalkingOptions, WeakMap<JSONSchema4, string[]>>();
1212
function _mergeAllOf(schema: JSONSchema4, path: JsonPath, opts: WalkingOptions) {
1313
return resolveAllOf(cloneDeep(schema), {
1414
deep: false,
15-
resolvers: {
16-
defaultResolver(values: unknown) {
17-
if (Array.isArray(values)) {
18-
return values;
19-
}
20-
21-
return Object.assign({}, ...Object(values));
22-
},
23-
example(values: unknown[]) {
24-
return resolveAllOf.options.resolvers.enum(values) || null;
25-
},
26-
enum(values: unknown[]) {
27-
return resolveAllOf.options.resolvers.enum(compact(values)) || [];
28-
},
29-
$ref(values: unknown) {
30-
return {};
31-
},
32-
},
15+
resolvers: resolveAllOf.stoplightResolvers,
3316
$refResolver($ref: unknown) {
3417
if (typeof $ref !== 'string') {
3518
return {};

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,10 +1570,10 @@
15701570
lodash "^4.17.4"
15711571
read-pkg-up "^7.0.0"
15721572

1573-
"@stoplight/json-schema-merge-allof@^0.7.0":
1574-
version "0.7.0"
1575-
resolved "https://registry.yarnpkg.com/@stoplight/json-schema-merge-allof/-/json-schema-merge-allof-0.7.0.tgz#c3bad916c813d41a1ad385182a465cce2a14abbd"
1576-
integrity sha512-tMeLC52x+46t5NJ8nrNiZcFVK/V9XKRM/89WG7VT6zmKP+QS/Q6iORUTja6Am6YeBUT9rjP/W9gC4FBiiutUXA==
1573+
"@stoplight/json-schema-merge-allof@^0.7.1":
1574+
version "0.7.1"
1575+
resolved "https://registry.yarnpkg.com/@stoplight/json-schema-merge-allof/-/json-schema-merge-allof-0.7.1.tgz#7a2c99da9448c5b6b5cbd9afd9f1fb4957d5cbeb"
1576+
integrity sha512-S+pemVEAhqZPb88WstIbRg8yCMoYr6/+MjPS3/ngXPZ/y+hgG/ax26lTr0E8gmFc9kByIIixjF18ZqmC0DlGHg==
15771577
dependencies:
15781578
compute-lcm "^1.1.0"
15791579
json-schema-compare "^0.2.2"

0 commit comments

Comments
 (0)