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

feat(schema): use ajv v8 #1584

Merged
merged 16 commits into from
Apr 29, 2021
Merged

feat(schema): use ajv v8 #1584

merged 16 commits into from
Apr 29, 2021

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented Apr 26, 2021

Fixes #1556

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

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. Use oasSchema function from the OAS ruleset if you want to supply OAS Schema Object.

@P0lip P0lip added enhancement New feature or request breaking Pull requests that introduce a breaking change labels Apr 26, 2021
@P0lip P0lip self-assigned this Apr 26, 2021
@P0lip P0lip marked this pull request as ready for review April 27, 2021 11:06
@P0lip P0lip requested review from a team and paulatulis and removed request for a team April 27, 2021 11:28
Copy link
Contributor

@domagojk domagojk left a 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', () => {
Copy link
Contributor

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?

Copy link
Contributor Author

@P0lip P0lip Apr 28, 2021

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.

@P0lip
Copy link
Contributor Author

P0lip commented Apr 28, 2021

Btw, couldn't you make should -> must and pretty formatter as a separate issue/PR? Since this is already huge weary

It's Ajv 8 that changed the messages underneath 🤷‍♂️, so it's not something I have influence on.

BUT, I have an idea!

@P0lip
Copy link
Contributor Author

P0lip commented Apr 28, 2021

Here it is #1587

Copy link
Contributor

@domagojk domagojk left a 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

@P0lip
Copy link
Contributor Author

P0lip commented Apr 29, 2021

@wmhilton fancy reviewing it at your leisure?
I'll merge this in the meantime, as this is going to block my other PR I'm about to create now.

@P0lip P0lip merged commit e1133e5 into develop Apr 29, 2021
@P0lip P0lip deleted the feat/ajv-v8 branch April 29, 2021 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Pull requests that introduce a breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing json-schema drafts
2 participants