refactor: split in two packages: core and cli (#223)

This commit is contained in:
Andriy Leliv
2020-11-13 21:13:47 +02:00
committed by GitHub
parent 8f2dc079d7
commit 9ec79d21ea
180 changed files with 11778 additions and 3204 deletions

View File

@@ -0,0 +1,22 @@
import { Oas3Rule, Oas2Rule } from '../../visitors';
import { Oas2Parameter } from '../../typings/swagger';
import { Oas3Parameter } from '../../typings/openapi';
import { UserContext } from '../../walk';
export const ParameterDescription: Oas3Rule | Oas2Rule = () => {
return {
Parameter(parameter: Oas2Parameter | Oas3Parameter, { report, location }: UserContext) {
if (parameter.description === undefined) {
report({
message: 'Parameter object description must be present.',
location: { reportOnKey: true },
});
} else if (!parameter.description) {
report({
message: 'Parameter object description must be non-empty string.',
location: location.child(['description']),
});
}
},
};
};