Skip to content

Commit

Permalink
fix(stoplightio#15): dont check description text
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvoedi committed Aug 6, 2024
1 parent a34ca1b commit 5f67add
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 153 deletions.
139 changes: 0 additions & 139 deletions __tests__/docs-description.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 --

{
Expand Down Expand Up @@ -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: {
Expand All @@ -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 ---

{
Expand Down
14 changes: 0 additions & 14 deletions src/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,6 @@ export default {
min: 20,
},
},
{
field: "description",
function: pattern,
functionOptions: {
match: "/^[A-Z]/",
},
},
{
field: "description",
function: pattern,
functionOptions: {
match: "\\.$",
},
},
],
},

Expand Down

0 comments on commit 5f67add

Please sign in to comment.