-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multiline support for docs-description #15
Comments
I've noticed the same issue in a project. |
The problem with this approach is that, according to the OpenAPI specification, CommonMark or Markdown is valid in descriptions. This means that pretty much any restriction to the format of the text causes problems in certain exceptional cases, for example if the text does not end with a period but with a Markdown table. See the OpenAPI Spec for more information about this. It would probably be best not to check the structure of the text. |
I agree. We can make a fix for this. Why is is the first line should end with a period rather than the full description ending with a period? @paul-barton |
Currently it appears that any multiline description throws a warning with
"\\.$".spectral(docs-description)
.This is an enhancement request to add multiline support for
docs-description
rule.Context
Update
docs-description
to allow multiline descriptions without warnings.Current Behavior
The following throws a warning with
"\\.$".spectral(docs-description)
:Expected Behavior
Multiline descriptions have no warnings and only first line checks that the first character is an upper case letter and ends with a period, ignoring indentation used. With support for all YAML Multiline Block Scalars
Possible Solution(s)
Maybe update regex pattern to use
^(([|>]{1})([-+]?)([1-9]?)\n+ {1,9})?([A-Z].*\.)(\n(?:.|\n)*)?$
for checking first character is upper case and ends with a period on the first line, ignoring indentation used.Simply validate the first line for docs-description.
We have more stuff to describe.
Multiline support would be great.
We have more stuff to describe.
Multiline support would be great.
Tested working in custom rule:
The text was updated successfully, but these errors were encountered: