I wish there were a simpler way to configure a custom rule to operate on any schema node #2463
Unanswered
jedwards1211
asked this question in
General
Replies: 1 comment
-
I tried to use these aliases to get to schema nodes:
It works locally, but I get these errors when running in Bitbucket pipeline. Any idea why?
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Admittedly I'm new to this and may not know how to do something, but I went to look at the
oas3-valid-schema-example
rule to see how it's configured to only operate on schemas, and I was surprised that it does that using complicated JSONPath operations:I wish I could just say something like
nodeTypes: ['schema']
instead of using these complicated filter paths.According to the company I work for many customers use the OpenAPI any schema
{}
by mistake instead of actually meaning any schema, and I'd like to make a lint rule to warn about that unless they add an explicitx-any: true
marker property. But matching objects that are schemas without any validation properties with JSONPaths isn't going to be straightforward.Before discovering spectral I had started writing my own lint tool from scratch using some of my company's own traversal tools that made it easy to target any schema nodes, and it was a lot easier.
Beta Was this translation helpful? Give feedback.
All reactions