Skip to content

Commit

Permalink
feat: remove the idea of pipes, matches on rule format hould be exact
Browse files Browse the repository at this point in the history
  • Loading branch information
casserni committed Dec 3, 2018
1 parent 6c11f7e commit 7ba143e
Show file tree
Hide file tree
Showing 9 changed files with 419 additions and 461 deletions.
14 changes: 1 addition & 13 deletions src/__tests__/spectral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('spectral', () => {
});

const results = s.run({ target: todosPartialDeref, spec: 'oas2' });
expect(results.length).toBe(0);
expect(results.length).toBeGreaterThan(0);
});

// Assures: https://stoplightio.atlassian.net/browse/SL-786
Expand Down Expand Up @@ -193,18 +193,6 @@ Array [
},
},
},
'oas2|oas3': {
rule2: {
type: RuleType.STYLE,
function: RuleFunction.TRUTHY,
path: '$',
enabled: false,
summary: '',
input: {
properties: 'something-not-present',
},
},
},
oas3: {
rule3: {
type: RuleType.STYLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('oasOp2xxResponse', () => {
rules: {
oas2: {
'operation-2xx-response': Object.assign(
ruleset.rules['oas2|oas3']['operation-2xx-response'],
ruleset.rules.oas2['operation-2xx-response'],
{
enabled: true,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('oasOpFormDataConsumeCheck', () => {
rules: {
oas2: {
'operation-formData-consume-check': Object.assign(
ruleset.rules['oas2|oas3']['operation-formData-consume-check'],
ruleset.rules.oas2['operation-formData-consume-check'],
{
enabled: true,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('oasOpIdUnique', () => {
rules: {
oas2: {
'operation-operationId-unique': Object.assign(
ruleset.rules['oas2|oas3']['operation-operationId-unique'],
ruleset.rules.oas2['operation-operationId-unique'],
{
enabled: true,
}
Expand Down
9 changes: 3 additions & 6 deletions src/rulesets/oas/functions/oasOpParams/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ describe('oasOpParams', () => {
functions: ruleset.functions,
rules: {
oas2: {
'operation-parameters': Object.assign(
ruleset.rules['oas2|oas3']['operation-parameters'],
{
enabled: true,
}
),
'operation-parameters': Object.assign(ruleset.rules.oas2['operation-parameters'], {
enabled: true,
}),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/rulesets/oas/functions/oasPathParam/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('oasPathParam', () => {
functions: ruleset.functions,
rules: {
oas2: {
'path-params': Object.assign(ruleset.rules['oas2|oas3']['path-params'], {
'path-params': Object.assign(ruleset.rules.oas2['path-params'], {
enabled: true,
}),
},
Expand Down
Loading

0 comments on commit 7ba143e

Please sign in to comment.