@ibm-cloud/openapi-ruleset-utilities
Advanced tools
Comparing version 0.0.2-rc.1 to 1.0.0-rc.1
{ | ||
"name": "@ibm-cloud/openapi-ruleset-utilities", | ||
"description": "Programmatic utility functions for creating Spectral-formatted OpenAPI Rulesets", | ||
"version": "0.0.2-rc.1", | ||
"version": "1.0.0-rc.1", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "private": false, |
@@ -22,3 +22,3 @@ /** | ||
'$.paths[*][*].responses[*].headers[*].schema', | ||
'$.paths[*][*][requestBody].content[*].schema' | ||
'$.paths[*][*][requestBody].content[*].schema', | ||
]; | ||
@@ -31,3 +31,3 @@ | ||
'$.paths[*].parameters[*]', | ||
'$.paths[*][get,put,post,delete,options,head,patch,trace].parameters[*]' | ||
'$.paths[*][get,put,post,delete,options,head,patch,trace].parameters[*]', | ||
]; | ||
@@ -45,3 +45,3 @@ | ||
'$.paths[*][*].responses[*].content[*].schema', | ||
'$.components.responses[*].content[*].schema' | ||
'$.components.responses[*].content[*].schema', | ||
]; | ||
@@ -53,3 +53,3 @@ | ||
'$.paths[*][*].requestBody.content[*].schema', | ||
'$.components.requestBodies[*].content[*].schema' | ||
'$.components.requestBodies[*].content[*].schema', | ||
]; | ||
@@ -81,3 +81,3 @@ | ||
'$.components.responses[*].headers[*].schema', | ||
'$.components.responses[*].headers[*].content[*].schema' | ||
'$.components.responses[*].headers[*].content[*].schema', | ||
]; | ||
@@ -97,3 +97,3 @@ | ||
schemas, | ||
securitySchemes | ||
securitySchemes, | ||
}; |
@@ -9,4 +9,4 @@ /** | ||
collections: { | ||
...require('./collections') | ||
} | ||
...require('./collections'), | ||
}, | ||
}; |
@@ -33,3 +33,3 @@ /** | ||
STRING: Symbol('string'), | ||
UNKNOWN: Symbol('unknown') | ||
UNKNOWN: Symbol('unknown'), | ||
}; | ||
@@ -336,3 +336,3 @@ | ||
isPrimitiveSchema, | ||
isStringSchema | ||
isStringSchema, | ||
}; |
@@ -15,3 +15,3 @@ /** | ||
validateNestedSchemas: require('./validate-nested-schemas'), | ||
validateSubschemas: require('./validate-subschemas') | ||
validateSubschemas: require('./validate-subschemas'), | ||
}; |
@@ -27,4 +27,4 @@ /** | ||
two: {}, | ||
three: {} | ||
} | ||
three: {}, | ||
}, | ||
}).sort() | ||
@@ -38,3 +38,3 @@ ).toEqual(['three', 'two', 'one'].sort()); | ||
properties: { | ||
one: {} | ||
one: {}, | ||
}, | ||
@@ -44,5 +44,5 @@ allOf: [ | ||
properties: { | ||
two: {} | ||
} | ||
} | ||
two: {}, | ||
}, | ||
}, | ||
], | ||
@@ -52,5 +52,5 @@ oneOf: [ | ||
properties: { | ||
three: {} | ||
} | ||
} | ||
three: {}, | ||
}, | ||
}, | ||
], | ||
@@ -60,6 +60,6 @@ anyOf: [ | ||
properties: { | ||
four: {} | ||
} | ||
} | ||
] | ||
four: {}, | ||
}, | ||
}, | ||
], | ||
}).sort() | ||
@@ -73,3 +73,3 @@ ).toEqual(['four', 'three', 'two', 'one'].sort()); | ||
properties: { | ||
one: {} | ||
one: {}, | ||
}, | ||
@@ -79,3 +79,3 @@ allOf: [ | ||
properties: { | ||
two: {} | ||
two: {}, | ||
}, | ||
@@ -85,3 +85,3 @@ oneOf: [ | ||
properties: { | ||
three: {} | ||
three: {}, | ||
}, | ||
@@ -91,10 +91,10 @@ anyOf: [ | ||
properties: { | ||
four: {} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
four: {}, | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
], | ||
}).sort() | ||
@@ -108,3 +108,3 @@ ).toEqual(['four', 'three', 'two', 'one'].sort()); | ||
properties: { | ||
one: {} | ||
one: {}, | ||
}, | ||
@@ -114,6 +114,6 @@ allOf: [ | ||
properties: { | ||
one: {} | ||
} | ||
} | ||
] | ||
one: {}, | ||
}, | ||
}, | ||
], | ||
}) | ||
@@ -130,4 +130,4 @@ ).toEqual(['one']); | ||
two: {}, | ||
three: {} | ||
} | ||
three: {}, | ||
}, | ||
}, | ||
@@ -146,4 +146,4 @@ name => name.indexOf('o') !== -1 | ||
two: {}, | ||
three: { nullable: true } | ||
} | ||
three: { nullable: true }, | ||
}, | ||
}, | ||
@@ -150,0 +150,0 @@ (_, schema) => schema.nullable === true |
@@ -51,6 +51,6 @@ /** | ||
{ | ||
allOf: [{ anyOf: [{ items: {} }, { type: 'array' }] }, {}] | ||
allOf: [{ anyOf: [{ items: {} }, { type: 'array' }] }, {}], | ||
}, | ||
{ type: 'array' } | ||
] | ||
{ type: 'array' }, | ||
], | ||
}) | ||
@@ -57,0 +57,0 @@ ).toBe(true); |
@@ -53,10 +53,10 @@ /** | ||
{ type: 'string', format: 'binary' }, | ||
{ type: 'string', format: 'binary' } | ||
] | ||
{ type: 'string', format: 'binary' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'string', format: 'binary' } | ||
] | ||
{ type: 'string', format: 'binary' }, | ||
], | ||
}) | ||
@@ -63,0 +63,0 @@ ).toBe(true); |
@@ -39,6 +39,6 @@ /** | ||
{ | ||
allOf: [{ anyOf: [{ type: 'boolean' }, { type: 'boolean' }] }, {}] | ||
allOf: [{ anyOf: [{ type: 'boolean' }, { type: 'boolean' }] }, {}], | ||
}, | ||
{ type: 'boolean' } | ||
] | ||
{ type: 'boolean' }, | ||
], | ||
}) | ||
@@ -45,0 +45,0 @@ ).toBe(true); |
@@ -53,10 +53,10 @@ /** | ||
{ type: 'string', format: 'byte' }, | ||
{ type: 'string', format: 'byte' } | ||
] | ||
{ type: 'string', format: 'byte' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'string', format: 'byte' } | ||
] | ||
{ type: 'string', format: 'byte' }, | ||
], | ||
}) | ||
@@ -63,0 +63,0 @@ ).toBe(true); |
@@ -53,10 +53,10 @@ /** | ||
{ type: 'string', format: 'date' }, | ||
{ type: 'string', format: 'date' } | ||
] | ||
{ type: 'string', format: 'date' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'string', format: 'date' } | ||
] | ||
{ type: 'string', format: 'date' }, | ||
], | ||
}) | ||
@@ -63,0 +63,0 @@ ).toBe(true); |
@@ -55,10 +55,10 @@ /** | ||
{ type: 'string', format: 'date-time' }, | ||
{ type: 'string', format: 'date-time' } | ||
] | ||
{ type: 'string', format: 'date-time' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'string', format: 'date-time' } | ||
] | ||
{ type: 'string', format: 'date-time' }, | ||
], | ||
}) | ||
@@ -65,0 +65,0 @@ ).toBe(true); |
@@ -53,10 +53,10 @@ /** | ||
{ type: 'number', format: 'double' }, | ||
{ type: 'number', format: 'double' } | ||
] | ||
{ type: 'number', format: 'double' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'number', format: 'double' } | ||
] | ||
{ type: 'number', format: 'double' }, | ||
], | ||
}) | ||
@@ -63,0 +63,0 @@ ).toBe(true); |
@@ -44,10 +44,10 @@ /** | ||
{ type: 'string', enum: ['one'] }, | ||
{ type: 'string', enum: ['two'] } | ||
] | ||
{ type: 'string', enum: ['two'] }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'string', enum: ['three'] } | ||
] | ||
{ type: 'string', enum: ['three'] }, | ||
], | ||
}) | ||
@@ -54,0 +54,0 @@ ).toBe(true); |
@@ -53,10 +53,10 @@ /** | ||
{ type: 'number', format: 'float' }, | ||
{ type: 'number', format: 'float' } | ||
] | ||
{ type: 'number', format: 'float' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'number', format: 'float' } | ||
] | ||
{ type: 'number', format: 'float' }, | ||
], | ||
}) | ||
@@ -63,0 +63,0 @@ ).toBe(true); |
@@ -53,10 +53,10 @@ /** | ||
{ type: 'integer', format: 'int32' }, | ||
{ type: 'integer', format: 'int32' } | ||
] | ||
{ type: 'integer', format: 'int32' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'integer', format: 'int32' } | ||
] | ||
{ type: 'integer', format: 'int32' }, | ||
], | ||
}) | ||
@@ -63,0 +63,0 @@ ).toBe(true); |
@@ -53,10 +53,10 @@ /** | ||
{ type: 'integer', format: 'int64' }, | ||
{ type: 'integer', format: 'int64' } | ||
] | ||
{ type: 'integer', format: 'int64' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'integer', format: 'int64' } | ||
] | ||
{ type: 'integer', format: 'int64' }, | ||
], | ||
}) | ||
@@ -63,0 +63,0 @@ ).toBe(true); |
@@ -39,6 +39,6 @@ /** | ||
{ | ||
allOf: [{ anyOf: [{ type: 'integer' }, { type: 'integer' }] }, {}] | ||
allOf: [{ anyOf: [{ type: 'integer' }, { type: 'integer' }] }, {}], | ||
}, | ||
{ type: 'integer' } | ||
] | ||
{ type: 'integer' }, | ||
], | ||
}) | ||
@@ -45,0 +45,0 @@ ).toBe(true); |
@@ -39,6 +39,6 @@ /** | ||
{ | ||
allOf: [{ anyOf: [{ type: 'number' }, { type: 'number' }] }, {}] | ||
allOf: [{ anyOf: [{ type: 'number' }, { type: 'number' }] }, {}], | ||
}, | ||
{ type: 'number' } | ||
] | ||
{ type: 'number' }, | ||
], | ||
}) | ||
@@ -45,0 +45,0 @@ ).toBe(true); |
@@ -59,6 +59,6 @@ /** | ||
{ | ||
allOf: [{ properties: {} }, {}] | ||
allOf: [{ properties: {} }, {}], | ||
}, | ||
{ type: 'object' } | ||
] | ||
{ type: 'object' }, | ||
], | ||
}) | ||
@@ -73,8 +73,8 @@ ).toBe(true); | ||
{ | ||
allOf: [{ properties: {} }, {}] | ||
allOf: [{ properties: {} }, {}], | ||
}, | ||
{ | ||
properties: {} | ||
} | ||
] | ||
properties: {}, | ||
}, | ||
], | ||
}) | ||
@@ -89,8 +89,8 @@ ).toBe(true); | ||
{ | ||
allOf: [{ properties: {} }, {}] | ||
allOf: [{ properties: {} }, {}], | ||
}, | ||
{ | ||
properties: {} | ||
} | ||
] | ||
properties: {}, | ||
}, | ||
], | ||
}) | ||
@@ -97,0 +97,0 @@ ).toBe(true); |
@@ -76,10 +76,10 @@ /** | ||
{ type: 'integer', format: 'int32' }, | ||
{ type: 'integer', format: 'int32' } | ||
] | ||
{ type: 'integer', format: 'int32' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'integer', format: 'int32' } | ||
] | ||
{ type: 'integer', format: 'int32' }, | ||
], | ||
}) | ||
@@ -98,10 +98,10 @@ ).toBe(true); | ||
{ type: 'number', format: 'double' }, | ||
{ type: 'number', format: 'double' } | ||
] | ||
{ type: 'number', format: 'double' }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ type: 'number', format: 'double' } | ||
] | ||
{ type: 'number', format: 'double' }, | ||
], | ||
}) | ||
@@ -116,6 +116,6 @@ ).toBe(true); | ||
{ | ||
allOf: [{ anyOf: [{ type: 'number' }, { type: 'number' }] }, {}] | ||
allOf: [{ anyOf: [{ type: 'number' }, { type: 'number' }] }, {}], | ||
}, | ||
{ type: 'number' } | ||
] | ||
{ type: 'number' }, | ||
], | ||
}) | ||
@@ -130,6 +130,6 @@ ).toBe(true); | ||
{ | ||
allOf: [{ anyOf: [{ type: 'boolean' }, { type: 'boolean' }] }, {}] | ||
allOf: [{ anyOf: [{ type: 'boolean' }, { type: 'boolean' }] }, {}], | ||
}, | ||
{ type: 'boolean' } | ||
] | ||
{ type: 'boolean' }, | ||
], | ||
}) | ||
@@ -144,6 +144,6 @@ ).toBe(true); | ||
{ | ||
allOf: [{ anyOf: [{ type: 'string' }, { type: 'string' }] }, {}] | ||
allOf: [{ anyOf: [{ type: 'string' }, { type: 'string' }] }, {}], | ||
}, | ||
{ type: 'string' } | ||
] | ||
{ type: 'string' }, | ||
], | ||
}) | ||
@@ -150,0 +150,0 @@ ).toBe(true); |
@@ -39,6 +39,6 @@ /** | ||
{ | ||
allOf: [{ anyOf: [{ type: 'string' }, { type: 'string' }] }, {}] | ||
allOf: [{ anyOf: [{ type: 'string' }, { type: 'string' }] }, {}], | ||
}, | ||
{ type: 'string' } | ||
] | ||
{ type: 'string' }, | ||
], | ||
}) | ||
@@ -45,0 +45,0 @@ ).toBe(true); |
@@ -45,3 +45,3 @@ /** | ||
const schemaWithAllCompliantOneOfs = { | ||
oneOf: [{ fred: null }, { fred: null }, { fred: null }] | ||
oneOf: [{ fred: null }, { fred: null }, { fred: null }], | ||
}; | ||
@@ -55,3 +55,3 @@ expect(schemaHasConstraint(schemaWithAllCompliantOneOfs, fredIsNull)).toBe( | ||
const schemaWithAllCompliantAnyOfs = { | ||
anyOf: [{ fred: null }, { fred: null }, { fred: null }] | ||
anyOf: [{ fred: null }, { fred: null }, { fred: null }], | ||
}; | ||
@@ -65,3 +65,3 @@ expect(schemaHasConstraint(schemaWithAllCompliantAnyOfs, fredIsNull)).toBe( | ||
const schemaWithOneCompliantAllOf = { | ||
allOf: [{}, { fred: null }, {}] | ||
allOf: [{}, { fred: null }, {}], | ||
}; | ||
@@ -75,3 +75,3 @@ expect(schemaHasConstraint(schemaWithOneCompliantAllOf, fredIsNull)).toBe( | ||
const schemaWithOneCompliantOneOf = { | ||
anyOf: [{}, { fred: null }, {}] | ||
anyOf: [{}, { fred: null }, {}], | ||
}; | ||
@@ -85,3 +85,3 @@ expect(schemaHasConstraint(schemaWithOneCompliantOneOf, fredIsNull)).toBe( | ||
const schemaWithOneCompliantAnyOf = { | ||
anyOf: [{}, { fred: null }, {}] | ||
anyOf: [{}, { fred: null }, {}], | ||
}; | ||
@@ -97,3 +97,3 @@ expect(schemaHasConstraint(schemaWithOneCompliantAnyOf, fredIsNull)).toBe( | ||
anyOf: [{ fred: null }, {}], | ||
allOf: [{}, {}] | ||
allOf: [{}, {}], | ||
}; | ||
@@ -109,3 +109,3 @@ expect(schemaHasConstraint(schemaWithOnlyOneOfCompliance, fredIsNull)).toBe( | ||
oneOf: [{ fred: null }, {}], | ||
allOf: [{}, {}] | ||
allOf: [{}, {}], | ||
}; | ||
@@ -121,3 +121,3 @@ expect(schemaHasConstraint(schemaWithOnlyAnyOfCompliance, fredIsNull)).toBe( | ||
oneOf: [{}, { fred: null }], | ||
anyOf: [{ fred: null }, {}] | ||
anyOf: [{ fred: null }, {}], | ||
}; | ||
@@ -133,6 +133,6 @@ expect(schemaHasConstraint(schemaWithOnlyAllOfCompliance, fredIsNull)).toBe( | ||
{ | ||
allOf: [{ fred: null }, {}] | ||
allOf: [{ fred: null }, {}], | ||
}, | ||
{ fred: null } | ||
] | ||
{ fred: null }, | ||
], | ||
}; | ||
@@ -146,6 +146,6 @@ expect(schemaHasConstraint(schemaWithAllOfInOneOf, fredIsNull)).toBe(true); | ||
{ | ||
anyOf: [{ fred: null }, { fred: null }] | ||
anyOf: [{ fred: null }, { fred: null }], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}; | ||
@@ -159,6 +159,6 @@ expect(schemaHasConstraint(schemaWithAnyOfInAllOf, fredIsNull)).toBe(true); | ||
{ | ||
oneOf: [{ fred: null }, { fred: null }] | ||
oneOf: [{ fred: null }, { fred: null }], | ||
}, | ||
{ fred: null } | ||
] | ||
{ fred: null }, | ||
], | ||
}; | ||
@@ -165,0 +165,0 @@ expect(schemaHasConstraint(schemaWithAnyOfInAllOf, fredIsNull)).toBe(true); |
@@ -46,4 +46,4 @@ /** | ||
{ properties: { my_property: {} } }, | ||
{ properties: { my_property: {} } } | ||
] | ||
{ properties: { my_property: {} } }, | ||
], | ||
}; | ||
@@ -60,4 +60,4 @@ expect(schemaHasProperty(schemaWithAllCompliantOneOfs, 'my_property')).toBe( | ||
{ properties: { my_property: {} } }, | ||
{ properties: { my_property: {} } } | ||
] | ||
{ properties: { my_property: {} } }, | ||
], | ||
}; | ||
@@ -71,3 +71,3 @@ expect(schemaHasProperty(schemaWithAllCompliantAnyOfs, 'my_property')).toBe( | ||
const schemaWithOneCompliantAllOf = { | ||
allOf: [{}, { properties: { my_property: {} } }, {}] | ||
allOf: [{}, { properties: { my_property: {} } }, {}], | ||
}; | ||
@@ -81,3 +81,3 @@ expect(schemaHasProperty(schemaWithOneCompliantAllOf, 'my_property')).toBe( | ||
const schemaWithOneCompliantOneOf = { | ||
anyOf: [{}, { properties: { my_property: {} } }, {}] | ||
anyOf: [{}, { properties: { my_property: {} } }, {}], | ||
}; | ||
@@ -91,3 +91,3 @@ expect(schemaHasProperty(schemaWithOneCompliantOneOf, 'my_property')).toBe( | ||
const schemaWithOneCompliantAnyOf = { | ||
anyOf: [{}, { properties: { my_property: {} } }, {}] | ||
anyOf: [{}, { properties: { my_property: {} } }, {}], | ||
}; | ||
@@ -103,6 +103,6 @@ expect(schemaHasProperty(schemaWithOneCompliantAnyOf, 'my_property')).toBe( | ||
{ properties: { my_property: {} } }, | ||
{ properties: { my_property: {} } } | ||
{ properties: { my_property: {} } }, | ||
], | ||
anyOf: [{ properties: { my_property: {} } }, {}], | ||
allOf: [{}, {}] | ||
allOf: [{}, {}], | ||
}; | ||
@@ -118,6 +118,6 @@ expect( | ||
{ properties: { my_property: {} } }, | ||
{ properties: { my_property: {} } } | ||
{ properties: { my_property: {} } }, | ||
], | ||
oneOf: [{ properties: { my_property: {} } }, {}], | ||
allOf: [{}, {}] | ||
allOf: [{}, {}], | ||
}; | ||
@@ -133,3 +133,3 @@ expect( | ||
oneOf: [{}, { properties: { my_property: {} } }], | ||
anyOf: [{ properties: { my_property: {} } }, {}] | ||
anyOf: [{ properties: { my_property: {} } }, {}], | ||
}; | ||
@@ -145,6 +145,6 @@ expect( | ||
{ | ||
allOf: [{ properties: { my_property: {} } }, {}] | ||
allOf: [{ properties: { my_property: {} } }, {}], | ||
}, | ||
{ properties: { my_property: {} } } | ||
] | ||
{ properties: { my_property: {} } }, | ||
], | ||
}; | ||
@@ -160,7 +160,7 @@ expect(schemaHasProperty(schemaWithAllOfInOneOf, 'my_property')).toBe(true); | ||
{ properties: { my_property: {} } }, | ||
{ properties: { my_property: {} } } | ||
] | ||
{ properties: { my_property: {} } }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}; | ||
@@ -176,7 +176,7 @@ expect(schemaHasProperty(schemaWithAnyOfInAllOf, 'my_property')).toBe(true); | ||
{ properties: { my_property: {} } }, | ||
{ properties: { my_property: {} } } | ||
] | ||
{ properties: { my_property: {} } }, | ||
], | ||
}, | ||
{ properties: { my_property: {} } } | ||
] | ||
{ properties: { my_property: {} } }, | ||
], | ||
}; | ||
@@ -183,0 +183,0 @@ expect(schemaHasProperty(schemaWithAnyOfInAllOf, 'my_property')).toBe(true); |
@@ -24,3 +24,3 @@ /** | ||
required: ['fungibility'], | ||
properties: { fungibility: {} } | ||
properties: { fungibility: {} }, | ||
}; | ||
@@ -58,4 +58,4 @@ expect(schemaRequiresProperty(compliantSimpleSchema, 'fungibility')).toBe( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
] | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
}; | ||
@@ -72,4 +72,4 @@ expect( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
] | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
}; | ||
@@ -86,4 +86,4 @@ expect( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{} | ||
] | ||
{}, | ||
], | ||
}; | ||
@@ -100,4 +100,4 @@ expect( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{} | ||
] | ||
{}, | ||
], | ||
}; | ||
@@ -111,3 +111,3 @@ expect( | ||
const schemaWithOneCompliantAnyOf = { | ||
anyOf: [{}, { required: ['fungibility'] }, {}] | ||
anyOf: [{}, { required: ['fungibility'] }, {}], | ||
}; | ||
@@ -123,9 +123,9 @@ expect( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
anyOf: [ | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{} | ||
{}, | ||
], | ||
allOf: [{}, {}] | ||
allOf: [{}, {}], | ||
}; | ||
@@ -141,9 +141,9 @@ expect( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
oneOf: [ | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{} | ||
{}, | ||
], | ||
allOf: [{}, {}] | ||
allOf: [{}, {}], | ||
}; | ||
@@ -160,12 +160,12 @@ expect( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{} | ||
{}, | ||
], | ||
oneOf: [ | ||
{}, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
anyOf: [ | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{} | ||
] | ||
{}, | ||
], | ||
}; | ||
@@ -183,7 +183,7 @@ expect( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{} | ||
] | ||
{}, | ||
], | ||
}, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
] | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
}; | ||
@@ -201,7 +201,7 @@ expect(schemaRequiresProperty(schemaWithAllOfInOneOf, 'fungibility')).toBe( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
] | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}; | ||
@@ -219,7 +219,7 @@ expect(schemaRequiresProperty(schemaWithAnyOfInAllOf, 'fungibility')).toBe( | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
] | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
}, | ||
{ required: ['fungibility'], properties: { fungibility: {} } } | ||
] | ||
{ required: ['fungibility'], properties: { fungibility: {} } }, | ||
], | ||
}; | ||
@@ -226,0 +226,0 @@ expect(schemaRequiresProperty(schemaWithAnyOfInAllOf, 'fungibility')).toBe( |
@@ -15,14 +15,14 @@ /** | ||
contact: { | ||
email: 'example@example.com' | ||
} | ||
email: 'example@example.com', | ||
}, | ||
}, | ||
tags: [ | ||
{ | ||
name: 'Index' | ||
} | ||
name: 'Index', | ||
}, | ||
], | ||
servers: [ | ||
{ | ||
url: '/api/v3' | ||
} | ||
url: '/api/v3', | ||
}, | ||
], | ||
@@ -37,3 +37,3 @@ paths: { | ||
responses: { | ||
'200': { | ||
200: { | ||
description: "Here's the index.", | ||
@@ -43,9 +43,9 @@ content: { | ||
schema: { | ||
$ref: '#/components/schemas/Index' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
$ref: '#/components/schemas/Index', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
@@ -59,3 +59,3 @@ '/every_flavor': { | ||
responses: { | ||
'200': { | ||
200: { | ||
description: "Here's every flavor.", | ||
@@ -65,10 +65,10 @@ content: { | ||
schema: { | ||
$ref: '#/components/schemas/EveryFlavor' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
$ref: '#/components/schemas/EveryFlavor', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
@@ -81,23 +81,23 @@ components: { | ||
schema_with_property_schema: { | ||
$ref: '#/components/schemas/SchemaWithPropertySchema' | ||
$ref: '#/components/schemas/SchemaWithPropertySchema', | ||
}, | ||
schema_with_additional_properties_schema: { | ||
$ref: '#/components/schemas/SchemaWithAdditionalPropertiesSchema' | ||
$ref: '#/components/schemas/SchemaWithAdditionalPropertiesSchema', | ||
}, | ||
schema_with_items_schema: { | ||
$ref: '#/components/schemas/SchemaWithItemsSchema' | ||
$ref: '#/components/schemas/SchemaWithItemsSchema', | ||
}, | ||
schema_with_all_of_schema: { | ||
$ref: '#/components/schemas/SchemaWithAllOfSchema' | ||
$ref: '#/components/schemas/SchemaWithAllOfSchema', | ||
}, | ||
schema_with_one_of_schema: { | ||
$ref: '#/components/schemas/SchemaWithOneOfSchema' | ||
$ref: '#/components/schemas/SchemaWithOneOfSchema', | ||
}, | ||
schema_with_any_of_schema: { | ||
$ref: '#/components/schemas/SchemaWithAnyOfSchema' | ||
$ref: '#/components/schemas/SchemaWithAnyOfSchema', | ||
}, | ||
schema_with_not_schema: { | ||
$ref: '#/components/schemas/SchemaWithNotSchema' | ||
} | ||
} | ||
$ref: '#/components/schemas/SchemaWithNotSchema', | ||
}, | ||
}, | ||
}, | ||
@@ -107,29 +107,29 @@ EveryFlavor: { | ||
property_schema: { | ||
$ref: '#/components/schemas/SchemaWithPropertySchema' | ||
} | ||
$ref: '#/components/schemas/SchemaWithPropertySchema', | ||
}, | ||
}, | ||
additionalProperties: { | ||
$ref: '#/components/schemas/AdditionalPropertiesSchema' | ||
$ref: '#/components/schemas/AdditionalPropertiesSchema', | ||
}, | ||
items: { | ||
$ref: '#/components/schemas/ItemsSchema' | ||
$ref: '#/components/schemas/ItemsSchema', | ||
}, | ||
allOf: [ | ||
{ | ||
$ref: '#/components/schemas/AllOfSchema' | ||
} | ||
$ref: '#/components/schemas/AllOfSchema', | ||
}, | ||
], | ||
oneOf: [ | ||
{ | ||
$ref: '#/components/schemas/OneOfSchema' | ||
} | ||
$ref: '#/components/schemas/OneOfSchema', | ||
}, | ||
], | ||
anyOf: [ | ||
{ | ||
$ref: '#/components/schemas/AnyOfSchema' | ||
} | ||
$ref: '#/components/schemas/AnyOfSchema', | ||
}, | ||
], | ||
not: { | ||
$ref: '#/components/schemas/NotSchema' | ||
} | ||
$ref: '#/components/schemas/NotSchema', | ||
}, | ||
}, | ||
@@ -140,5 +140,5 @@ SchemaWithPropertySchema: { | ||
property_schema: { | ||
$ref: '#/components/schemas/PropertySchema' | ||
} | ||
} | ||
$ref: '#/components/schemas/PropertySchema', | ||
}, | ||
}, | ||
}, | ||
@@ -148,3 +148,3 @@ PropertySchema: { | ||
description: | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.' | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.', | ||
}, | ||
@@ -154,4 +154,4 @@ SchemaWithAdditionalPropertiesSchema: { | ||
additionalProperties: { | ||
$ref: '#/components/schemas/AdditionalPropertiesSchema' | ||
} | ||
$ref: '#/components/schemas/AdditionalPropertiesSchema', | ||
}, | ||
}, | ||
@@ -161,3 +161,3 @@ AdditionalPropertiesSchema: { | ||
description: | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.' | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.', | ||
}, | ||
@@ -167,4 +167,4 @@ SchemaWithItemsSchema: { | ||
items: { | ||
$ref: '#/components/schemas/ItemsSchema' | ||
} | ||
$ref: '#/components/schemas/ItemsSchema', | ||
}, | ||
}, | ||
@@ -174,3 +174,3 @@ ItemsSchema: { | ||
description: | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.' | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.', | ||
}, | ||
@@ -181,5 +181,5 @@ SchemaWithAllOfSchema: { | ||
{ | ||
$ref: '#/components/schemas/AllOfSchema' | ||
} | ||
] | ||
$ref: '#/components/schemas/AllOfSchema', | ||
}, | ||
], | ||
}, | ||
@@ -189,3 +189,3 @@ AllOfSchema: { | ||
description: | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.' | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.', | ||
}, | ||
@@ -196,5 +196,5 @@ SchemaWithOneOfSchema: { | ||
{ | ||
$ref: '#/components/schemas/OneOfSchema' | ||
} | ||
] | ||
$ref: '#/components/schemas/OneOfSchema', | ||
}, | ||
], | ||
}, | ||
@@ -204,3 +204,3 @@ OneOfSchema: { | ||
description: | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.' | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.', | ||
}, | ||
@@ -211,5 +211,5 @@ SchemaWithAnyOfSchema: { | ||
{ | ||
$ref: '#/components/schemas/AnyOfSchema' | ||
} | ||
] | ||
$ref: '#/components/schemas/AnyOfSchema', | ||
}, | ||
], | ||
}, | ||
@@ -219,3 +219,3 @@ AnyOfSchema: { | ||
description: | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.' | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.', | ||
}, | ||
@@ -225,4 +225,4 @@ SchemaWithNotSchema: { | ||
not: { | ||
$ref: '#/components/schemas/NotSchema' | ||
} | ||
$ref: '#/components/schemas/NotSchema', | ||
}, | ||
}, | ||
@@ -232,6 +232,6 @@ NotSchema: { | ||
description: | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.' | ||
} | ||
} | ||
} | ||
'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.', | ||
}, | ||
}, | ||
}, | ||
}; |
@@ -12,3 +12,3 @@ /** | ||
allSchemasDocument, | ||
testRule | ||
testRule, | ||
}; |
@@ -14,4 +14,4 @@ /** | ||
rules: { | ||
[ruleName]: rule | ||
} | ||
[ruleName]: rule, | ||
}, | ||
}); | ||
@@ -18,0 +18,0 @@ |
@@ -36,3 +36,3 @@ /** | ||
const schema = { | ||
allOf: [{}] | ||
allOf: [{}], | ||
}; | ||
@@ -54,3 +54,3 @@ | ||
const schema = { | ||
allOf: [{}, {}] | ||
allOf: [{}, {}], | ||
}; | ||
@@ -67,3 +67,3 @@ | ||
const schema = { | ||
oneOf: [{}, {}] | ||
oneOf: [{}, {}], | ||
}; | ||
@@ -80,3 +80,3 @@ | ||
const schema = { | ||
anyOf: [{}, {}] | ||
anyOf: [{}, {}], | ||
}; | ||
@@ -93,3 +93,3 @@ | ||
const schema = { | ||
not: {} | ||
not: {}, | ||
}; | ||
@@ -106,3 +106,3 @@ | ||
const schema = { | ||
not: {} | ||
not: {}, | ||
}; | ||
@@ -125,3 +125,3 @@ | ||
const schema = { | ||
allOf: [{ oneOf: [{ anyOf: [{ not: {} }] }] }] | ||
allOf: [{ oneOf: [{ anyOf: [{ not: {} }] }] }], | ||
}; | ||
@@ -139,3 +139,3 @@ | ||
'allOf.0.oneOf.0.anyOf.0', | ||
'allOf.0.oneOf.0.anyOf.0.not' | ||
'allOf.0.oneOf.0.anyOf.0.not', | ||
].sort() | ||
@@ -147,3 +147,3 @@ ); | ||
const schema = { | ||
allOf: [{ oneOf: [{ anyOf: [{ not: {} }] }] }] | ||
allOf: [{ oneOf: [{ anyOf: [{ not: {} }] }] }], | ||
}; | ||
@@ -171,4 +171,4 @@ | ||
two: {}, | ||
three: {} | ||
} | ||
three: {}, | ||
}, | ||
}; | ||
@@ -185,3 +185,3 @@ | ||
const schema = { | ||
additionalProperties: {} | ||
additionalProperties: {}, | ||
}; | ||
@@ -198,3 +198,3 @@ | ||
const schema = { | ||
items: {} | ||
items: {}, | ||
}; | ||
@@ -213,6 +213,6 @@ | ||
{ | ||
$ref: '#/components/schemas/SomeSchema' | ||
$ref: '#/components/schemas/SomeSchema', | ||
}, | ||
{} | ||
] | ||
{}, | ||
], | ||
}; | ||
@@ -219,0 +219,0 @@ |
@@ -37,4 +37,4 @@ /** | ||
properties: { | ||
nested_property: {} | ||
} | ||
nested_property: {}, | ||
}, | ||
}; | ||
@@ -59,4 +59,4 @@ | ||
two: {}, | ||
three: {} | ||
} | ||
three: {}, | ||
}, | ||
}; | ||
@@ -75,3 +75,3 @@ | ||
const schema = { | ||
additionalProperties: {} | ||
additionalProperties: {}, | ||
}; | ||
@@ -88,3 +88,3 @@ | ||
const schema = { | ||
items: {} | ||
items: {}, | ||
}; | ||
@@ -101,3 +101,3 @@ | ||
const schema = { | ||
allOf: [{ properties: { inside_all_of: {} } }] | ||
allOf: [{ properties: { inside_all_of: {} } }], | ||
}; | ||
@@ -116,3 +116,3 @@ | ||
const schema = { | ||
oneOf: [{ properties: { inside_one_of: {} } }] | ||
oneOf: [{ properties: { inside_one_of: {} } }], | ||
}; | ||
@@ -131,3 +131,3 @@ | ||
const schema = { | ||
anyOf: [{ properties: { inside_any_of: {} } }] | ||
anyOf: [{ properties: { inside_any_of: {} } }], | ||
}; | ||
@@ -146,3 +146,3 @@ | ||
const schema = { | ||
not: { properties: { inside_not: {} } } | ||
not: { properties: { inside_not: {} } }, | ||
}; | ||
@@ -159,3 +159,3 @@ | ||
const schema = { | ||
not: { properties: { inside_not: {} } } | ||
not: { properties: { inside_not: {} } }, | ||
}; | ||
@@ -178,3 +178,5 @@ | ||
const schema = { | ||
allOf: [{ oneOf: [{ anyOf: [{ properties: { can_you_find_me: {} } }] }] }] | ||
allOf: [ | ||
{ oneOf: [{ anyOf: [{ properties: { can_you_find_me: {} } }] }] }, | ||
], | ||
}; | ||
@@ -195,3 +197,3 @@ | ||
properties: { | ||
nested_property: {} | ||
nested_property: {}, | ||
}, | ||
@@ -201,6 +203,6 @@ additionalProperties: { | ||
{ | ||
items: {} | ||
} | ||
] | ||
} | ||
items: {}, | ||
}, | ||
], | ||
}, | ||
}; | ||
@@ -229,5 +231,5 @@ | ||
three: { | ||
$ref: '#/components/schemas/Three' | ||
} | ||
} | ||
$ref: '#/components/schemas/Three', | ||
}, | ||
}, | ||
}; | ||
@@ -234,0 +236,0 @@ |
@@ -29,3 +29,3 @@ /** | ||
'$.paths[*][*].responses[*].headers[*].schema', | ||
'$.paths[*][*][requestBody].content[*].schema' | ||
'$.paths[*][*][requestBody].content[*].schema', | ||
]; | ||
@@ -38,4 +38,4 @@ | ||
then: { | ||
function: ruleFunction | ||
} | ||
function: ruleFunction, | ||
}, | ||
}; | ||
@@ -42,0 +42,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
103956
3072
0