style-guide
style-guide copied to clipboard
[no-file-extensions-in-paths] complains about .xml and .json if XXX-json or XXX-xml is in the path
Should the "." in
notMatch: ".(json|xml|html|txt)$",
be escaped as \.
vs
"no-file-extensions-in-paths": {
message:
"Paths must not include file extensions such as .json, .xml, .html and .txt.",
description:
"Paths must not include file extensions such as `.json`, `.xml`, `.html` and `.txt`. Use the OpenAPI `content` keyword to tell consumers which Media Types are available.",
given: "$.paths[*]~",
then: {
function: pattern,
functionOptions: {
notMatch: ".(json|xml|html|txt)$",
},
},
severity: DiagnosticSeverity.Error,
},
Great spot, it definitely should. Can you fire over a quick PR with an accompanying test so you get the Internet Points?