-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
feat(schema): use ajv v8 #1584
feat(schema): use ajv v8 #1584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a first pass trough code and it looks good but there is a lot of things I don't understand so I will review it again a bit later.
Btw, couldn't you make should
-> must
and pretty formatter as a separate issue/PR? Since this is already huge 😩
@@ -57,7 +57,7 @@ describe('Pretty formatter', () => { | |||
expect(result).toContain(chalk.red.bold('1 Unique Issue(s)')); | |||
}); | |||
}); | |||
test('should wrap when terminal width is very small', () => { | |||
xtest('should wrap when terminal width is very small', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it disabled? If it is not necessary why not delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long story short - Spectral does not run CI Windows checks for PRs that are submitted by external contributors.
This test fails on Windows, and it wasn't caught in the PR that introduced the change, because the check was not executed :/
That's why I had to comment it out - I'll try to fix this Windows specific glitch in a separate issue.
It's Ajv 8 that changed the messages underneath 🤷♂️, so it's not something I have influence on. BUT, I have an idea! |
Here it is #1587 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I went trough it again and it looks good to me, but since my knowledge of spectral is not that great, probably best if others review it as well
@wmhilton fancy reviewing it at your leisure? |
Fixes #1556
Checklist
Does this PR introduce a breaking change?
Additional context
schema
function uses Ajv v8 in favor of Ajv v6. Moreover, in order to recognize a set of formats added in newer drafts,ajv-formats
is registered now either.It is preferred to provide JSON Schema Draft 7 schemas or newer, albeit older drafts are also supported via json-schema-migrate.
oasVersion
is no longer supported. UseoasSchema
function from the OAS ruleset if you want to supply OAS Schema Object.