-
Notifications
You must be signed in to change notification settings - Fork 161
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
Support JSON-schema assertion in configurable rules #1886
Comments
@RomanHotsiy from the context of the attached conversation I understand it's more about linting standalone JSON schemas themselves rather than linting OAS using JSON schemas, isn't it? |
@tatomyr Yes, exactly. (Hi, I'm the original reporter in that thread.) I want to lint my standalone schemas that aren't associated with any API definitions. I can do this today in Spectral with their custom rules, but I can't in Redocly. |
@hawkeyexl we first need to determine whether a document is a JSON schema. Additionally, identifying which draft it follows would be helpful. Would it be sufficient to assume a document is a JSON schema if it contains a |
I think that's reasonable. That's how VSCode's JSON Schema support works,
too.
…On Fri, Feb 7, 2025, 12:11 PM Andrew Tatomyr ***@***.***> wrote:
@hawkeyexl <https://github.com/hawkeyexl> we first need to determine
whether a document is a JSON schema. Additionally, identifying which draft
it follows would be helpful. Would it be sufficient to assume a document is
a JSON schema if it contains a $schema field with a link to the draft,
what do you think?
—
Reply to this email directly, view it on GitHub
<#1886 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHX2FZT35THFGDVWIBI6AT2OUHOZAVCNFSM6AAAAABWSUM5LSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNBUGAZTEMBSGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Good. |
be very careful with following anything VSC does with JSON Schema.. they are not the most compliant participant in the JSON Schema ecosystem, particularly around the |
This feature is nice in theory, but redocly needs an entry point which is one of Is this feature request going to add that behavior? @RomanHotsiy regarding the assertion, draft-04 (related to OAS 3.0.x)
draft-07 (related to Async)No explicit recommendation draft-2020-12 (Overlay/Arazzo/OAS 3.1.x)
|
Is your feature request related to a problem? Please describe.
Some people maintain JSON schemas to validate some parts of OpenAPI. We don't have a way to use them.
Describe the solution you'd like
I would like to add support for json schema assertion for our configurable rules. It may look like this:
Describe alternatives you've considered
Right now it is possible to achieve using custom assertions/rules via plugin: https://redocly.com/docs/cli/rules/configurable-rules#custom-function-example
Additional context
Reported in Write the Docs slack: https://writethedocs.slack.com/archives/C4EPE8332/p1738793608940479
The text was updated successfully, but these errors were encountered: