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: Upgrade AJV from 6 to 8 #31

Merged
merged 4 commits into from
Jun 28, 2023
Merged

Feat: Upgrade AJV from 6 to 8 #31

merged 4 commits into from
Jun 28, 2023

Conversation

vwong
Copy link
Contributor

@vwong vwong commented Jun 27, 2023

@@ -0,0 +1,20 @@
diff --git a/node_modules/ajv/dist/compile/validate/dataType.js b/node_modules/ajv/dist/compile/validate/dataType.js
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While waiting for ajv-validator/ajv#2297, we patch this locally

@@ -145,35 +145,6 @@ describe('openapi3/parser', () => {
}]);
});

it('should support the nullable schema keyword in an object property without type', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +63 to +64
exclusiveMaximum?: number;
exclusiveMinimum?: number;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenAPI defines these as booleans, as did AJV@6.

But since https://json-schema.org/draft-06/json-schema-release-notes.html, it has been converted to a number. AJV followed suite.

Comment on lines -359 to -361
const minimumInt64AllowedMinusOne = '-9223372036854775809';
const maximumInt64Allowed = '9223372036854775807';
const maximumInt64AllowedPlusOne = '9223372036854775808';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See ajv-validator/ajv-formats#22 (comment)

TLDR: JSON only supports doubles, and JS (without resorting to BigInt) too; pretending otherwise is pointless.

@vwong vwong marked this pull request as draft June 27, 2023 07:10
@vwong vwong marked this pull request as ready for review June 27, 2023 09:24
Copy link

@bethesque bethesque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷🏽‍♀️ I trust you Voon!

@Inksprout Inksprout self-requested a review June 28, 2023 00:28
@vwong vwong merged commit 5a17818 into master Jun 28, 2023
@vwong vwong deleted the chore/upgrade-ajv branch June 28, 2023 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants