Skip to content
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

[no-file-extensions-in-paths] complains about .xml and .json if XXX-json or XXX-xml is in the path #44

Open
mydeveloperday opened this issue Jun 24, 2023 · 1 comment

Comments

@mydeveloperday
Copy link

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,
    },
@philsturgeon
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants