Skip to content

Commit

Permalink
chore: add test case to provide failure example
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesmarx committed Jun 6, 2024
1 parent cc20565 commit 78bc188
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,25 @@ describe('MUST use standard formats for date and time properties [169]', () => {
}),
]);
});

test('null properties should not matter', async () => {
const openApi = await loadOpenApiSpec('base-openapi.yml');
openApi.paths['/example'].get.responses['200'].content['application/json']['examples'] = {
default: {
$ref: '#/components/examples/ExampleResponse',
},
};

openApi.components['examples'] = {
ExampleResponse: {
summary: 'example response with empty name',
value: {
name: null,
},
},
};

const result = await lint(openApi);
expect(result).toHaveLength(0);
});
});

0 comments on commit 78bc188

Please sign in to comment.