redocly-cli
redocly-cli copied to clipboard
Rules to disallow usage of vendor extensions
Hello, I didn't find any ready-made rule to avoid the use of vendor extensions and respect the basic standard. I made this custom one, but the warning doesn't come out on the right line. I think it would be interesting to have a basic rule for that.
Great work on this tool!
Describe the solution you'd like
rules:
no-vendor-extensions: warn/error
Describe alternatives you've considered
rules:
assert/no-vendor-extensions:
severity: warn
subject:
type: any
message: To respect the OpenAPI standard, please do not use vendor extensions
assertions:
notPattern: /^x-/
Additional context
Hi @kekel87,
Thanks for creating the issue!
However, I'd vote for extending the dissallowed assertion functions to accept RegExps (currently it only accepts arrays). So the rule could be written like this:
rules:
assert/no-vendor-extensions:
severity: warn
subject:
type: any
message: To respect the OpenAPI standard, please do not use vendor extensions
assertions:
disallowed: /^x-/