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

Added schema id check to the JsonSchemaResolver #2136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gokerakc
Copy link

@gokerakc gokerakc commented Nov 4, 2023

Issue: $id property is not required for JSON schemas but in the JsonSchemaResolver class we need to use the schema id value and there is no null check in place for it.

Current behavior: JsonSchemaResolver throws the following error when the provided schema does not have a schema id;

  • System.ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name' (error reason is not clear)

Desired behavior: JsonSchemaResolver throws the following exception when the schema id is null;

  • System.Exception: 'Provided schema does not have $id property.'

If you have a different solution for this issue or any suggestion for the exception message please let me know.

Copy link

cla-assistant bot commented Nov 4, 2023

CLA assistant check
All committers have signed the CLA.

@gokerakc gokerakc changed the title Added schema id check to JsonSchemaResolver Added schema id check to the JsonSchemaResolver Nov 4, 2023
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.

None yet

1 participant