diff --git a/__tests__/docs-description.test.ts b/__tests__/docs-description.test.ts index 7dce5da..fd3de39 100644 --- a/__tests__/docs-description.test.ts +++ b/__tests__/docs-description.test.ts @@ -62,80 +62,6 @@ testRule("docs-description", [ errors: [], }, - { - name: "invalid: description does not start capital letter", - document: { - openapi: "3.1.0", - info: { - description: - "lower case looks funny for most documentation tools and they dont wanna mess with your strings.", - }, - paths: { - "/foo/{id}": {}, - }, - }, - errors: [ - { - message: - '"lower case looks funny for most documentation tools and they dont wanna mess with your strings." must match the pattern "/^[A-Z]/".', - path: ["info", "description"], - severity: DiagnosticSeverity.Warning, - }, - ], - }, - - { - name: "valid: description must start capital letter", - document: { - openapi: "3.1.0", - info: { - description: - "Upper case looks more human for most documentation tools as they dont wanna mess with your strings.", - }, - paths: { - "/foo/{id}": {}, - }, - }, - errors: [], - }, - - { - name: "invalid: description needs a full stop at the end", - document: { - openapi: "3.1.0", - info: { - description: - "Descriptions are strings for humans, and they are sentences or paragaphs, so should end with a", - }, - paths: { - "/foo/{id}": {}, - }, - }, - errors: [ - { - message: - '"Descriptions are strings for humans, and they are sentences or paragaphs, so should end with a" must match the pattern "\\\\.$".', - path: ["info", "description"], - severity: DiagnosticSeverity.Warning, - }, - ], - }, - - { - name: "valid: description has a full stop at the end", - document: { - openapi: "3.1.0", - info: { - description: - "Descriptions are strings for humans, and they are sentences or paragaphs, so should end with a '.'.", - }, - paths: { - "/foo/{id}": {}, - }, - }, - errors: [], - }, - // -- schema description -- { @@ -197,30 +123,6 @@ testRule("docs-description", [ errors: [], }, - { - name: "invalid: description should start with capital letter", - document: { - openapi: "3.1.0", - info: { description: "Bla bla bla very interesting mmm yes." }, - components: { - schemas: { - Tree: { - description: - "a sapling, whether its tree, or a shrub, woodland or hedgerow, its all a Tree.", - }, - }, - }, - }, - errors: [ - { - message: - '"a sapling, whether its tree, or a shrub, woodland or hedgerow, its all a Tree." must match the pattern "/^[A-Z]/".', - path: ["components", "schemas", "Tree", "description"], - severity: DiagnosticSeverity.Warning, - }, - ], - }, - { name: "valid: description must start capital letter", document: { @@ -238,47 +140,6 @@ testRule("docs-description", [ errors: [], }, - { - name: "invalid: description needs a full stop at the end", - document: { - openapi: "3.1.0", - info: { description: "Bla bla bla very interesting mmm yes." }, - components: { - schemas: { - Tree: { - description: - "A sapling, whether its tree, or a shrub, woodland or hedgerow, its all a Tree", - }, - }, - }, - }, - errors: [ - { - message: - '"A sapling, whether its tree, or a shrub, woodland or hedgerow, its all a Tree" must match the pattern "\\\\.$".', - path: ["components", "schemas", "Tree", "description"], - severity: DiagnosticSeverity.Warning, - }, - ], - }, - - { - name: "valid: description has a full stop at the end", - document: { - openapi: "3.1.0", - info: { description: "Bla bla bla very interesting mmm yes." }, - components: { - schemas: { - Tree: { - description: - "A sapling, whether its tree, or a shrub, woodland or hedgerow, its all a Tree.", - }, - }, - }, - }, - errors: [], - }, - // --- parameter examples --- { diff --git a/src/ruleset.ts b/src/ruleset.ts index 26985c5..a3f6e87 100644 --- a/src/ruleset.ts +++ b/src/ruleset.ts @@ -188,20 +188,6 @@ export default { min: 20, }, }, - { - field: "description", - function: pattern, - functionOptions: { - match: "/^[A-Z]/", - }, - }, - { - field: "description", - function: pattern, - functionOptions: { - match: "\\.$", - }, - }, ], },