style-guide icon indicating copy to clipboard operation
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

Open mydeveloperday opened this issue 1 year ago • 1 comments

Should the "." in

notMatch: ".(json|xml|html|txt)$",

be escaped as \.

image

vs

image

"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,
    },

mydeveloperday avatar Jun 24 '23 11:06 mydeveloperday

Great spot, it definitely should. Can you fire over a quick PR with an accompanying test so you get the Internet Points?

philsturgeon avatar Jun 26 '23 14:06 philsturgeon