MDEV-30124: Add format validation for JSON Schema#4750
Open
varundeepsaini wants to merge 1 commit intoMariaDB:mainfrom
Open
MDEV-30124: Add format validation for JSON Schema#4750varundeepsaini wants to merge 1 commit intoMariaDB:mainfrom
varundeepsaini wants to merge 1 commit intoMariaDB:mainfrom
Conversation
293b984 to
e5142f5
Compare
e5142f5 to
5a6ab32
Compare
Implement optional format validation for the JSON_SCHEMA_VALID() function, as specified by JSON Schema Draft 2020-12. The format keyword is treated as an annotation by default (validation disabled). A new session variable json_schema_format_validation enables actual format validation when set to ON. Supported formats: date-time, date, time, duration, email, idn-email, hostname, idn-hostname, ipv4, ipv6, uri, uri-reference, iri, iri-reference, uuid, json-pointer, relative-json-pointer, regex. Signed-off-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com>
5a6ab32 to
602a323
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements optional format validation for the
JSON_SCHEMA_VALID()function per JSON Schema Draft 2020-12.json_schema_format_validation(defaultOFF)OFF, theformatkeyword is treated as annotation only (existing behavior)ON, validates strings against 18 format types:date-time,date,time,duration,email,idn-email,hostname,idn-hostname,ipv4,ipv6,uri,uri-reference,iri,iri-reference,uuid,json-pointer,relative-json-pointer,regexTest plan
json_schema_format_validation=ON