Skip to content

Conversation

makeItEasyQ
Copy link
Contributor

Support adding a custom message at attribute level and custom validator for all schema versions. The documented info for the custom validator, only supports one version, but actually, we may use different schemes by different members. So we can provide the JsonMetaSchema#getKeywords.
In this way, we can easy to add additional custom validators. For example:
JsonSchemaVersion jsonSchemaVersion = JsonSchemaFactory.checkVersion(versionFlag); JsonMetaSchema metaSchema = jsonSchemaVersion.getInstance(); metaSchema.getKeywords().put(DATE_PATTERN, new DatePatternKeyWord(DATE_PATTERN)); return JsonSchemaFactory.builder() .defaultMetaSchemaURI(metaSchema.getUri()) .addMetaSchema(metaSchema) .build();

@makeItEasyQ
Copy link
Contributor Author

Hi @stevehu,
Could you please help review these changes? Thanks very much!

@stevehu
Copy link
Contributor

stevehu commented Sep 13, 2022

@makeItEasyQ Thanks a lot for your help. I am in the process of reviewing the code. Look good to me but I need to make sure there is no backward compatibility issue.

@makeItEasyQ
Copy link
Contributor Author

@stevehu , Thanks very much!

@stevehu stevehu merged commit 6041dd7 into networknt:master Sep 16, 2022
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.

2 participants