Skip to content

Commit

Permalink
fix(types): update per suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfiel authored and tatomyr committed Oct 27, 2023
1 parent ac14b5c commit 1227789
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
19 changes: 1 addition & 18 deletions packages/core/src/__tests__/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,24 +402,7 @@ describe('lint', () => {
config: await makeConfig({ spec: 'error' }),
});

expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
[
{
"from": undefined,
"location": [
{
"pointer": "#/components/callbacks/resultCallback/{$url}/post/requestBody/content/application~1json/schema/properties/test",
"reportOnKey": true,
"source": "foobar.yaml",
},
],
"message": "Property \`test\` is not expected here.",
"ruleId": "spec",
"severity": "error",
"suggest": [],
},
]
`);
expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
});

it('should ignore error because ignore file passed', async () => {
Expand Down
15 changes: 7 additions & 8 deletions packages/core/src/types/oas3_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,13 @@ const Schema: NodeType = {
};

const SchemaProperties: NodeType = {
properties: {
propertyName: (value: any) => {
if (typeof value === 'boolean') {
return { type: 'boolean' };
} else {
return 'Schema';
}
},
properties: {},
additionalProperties: (value: any) => {
if (typeof value === 'boolean') {
return { type: 'boolean' };
} else {
return 'Schema';
}
},
};

Expand Down

0 comments on commit 1227789

Please sign in to comment.