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

NIFI-12725 Updated json-schema-validator to 1.3.2. #8405

Closed
wants to merge 2 commits into from

Conversation

dan-s1
Copy link
Contributor

@dan-s1 dan-s1 commented Feb 14, 2024

With the upgrade in version the change in json-schema-validator of URIs for schemas Draft 4, Draft 6 and Draft 7 had to be taken into account.

Summary

NIFI-12725

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

…ccount the change in json-schema-validator of URIs for schemas Draft 4, Draft 6 and Draft 7.
Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

@dan-s1 Can you provide some additional background on the reason for this change based on the changes in the validator library? The adjusted URI values seem odd in light of the unchanged values for 2019-09 and 2020-12, which makes me think there was some unexpected change in the validator library that should be considered.

@exceptionfactory
Copy link
Contributor

The latest version of json-schema-validator is now 1.3.2, so recommend changing to that version as part of this upgrade.

The following issue indicates some changes in the library for schema fragment handling, perhaps related, but it calls into question whether the reference URI values should be changed, or whether there is a better approach.

networknt/json-schema-validator#930

@dan-s1
Copy link
Contributor Author

dan-s1 commented Feb 14, 2024

@dan-s1 Can you provide some additional background on the reason for this change based on the changes in the validator library? The adjusted URI values seem odd in light of the unchanged values for 2019-09 and 2020-12, which makes me think there was some unexpected change in the validator library that should be considered.

I had to make these changes based on your suggestions in #8005 (comment)
Now that json-schema-validator changed some of the underlying URI strings that is why when Mike tried to upgrade there were issues as there were no matches for schemas 4, 6 and 7.

@exceptionfactory
Copy link
Contributor

@dan-s1 Can you provide some additional background on the reason for this change based on the changes in the validator library? The adjusted URI values seem odd in light of the unchanged values for 2019-09 and 2020-12, which makes me think there was some unexpected change in the validator library that should be considered.

I had to make these changes based on your suggestions in #8005 (comment) Now that json-schema-validator changed some of the underlying URI strings that is why when Mike tried to upgrade there were issues as there were no matches for schemas 4, 6 and 7.

For clarification, did you find the related changes in the json-schema-validator library that required the changes in NiFi? Recent versions included several other breaking changes, so this is something where it would be helpful to validate the changes in the library itself, as opposed to just making changes in NiFi immediately.

@dan-s1
Copy link
Contributor Author

dan-s1 commented Feb 14, 2024

Yes I found the changes to the URI strings here. As you had suggested the URI strings were a way to link back to the json-schema-validator API without specifying the API when defining org.apache.nifi.json.schema.SchemaVersion. Without my changes there is no way to use the latest version of the API with the current design of the code.

@dan-s1 dan-s1 changed the title NIFI-12725 Updated json-schema-validator to 1.3.0. NIFI-12725 Updated json-schema-validator to 1.3.2. Feb 14, 2024
@dan-s1
Copy link
Contributor Author

dan-s1 commented Feb 14, 2024

@exceptionfactory Can you please clarify what you mean by "breaking changes" in regards to the NIFI code? As far as I can see the NIFI code is not adding functionality, it merely is a pass through so the json-schema-validator API could be used.

@exceptionfactory
Copy link
Contributor

@exceptionfactory Can you please clarify what you mean by "breaking changes" in regards to the NIFI code? As far as I can see the NIFI code is not adding functionality, it merely is a pass through so the json-schema-validator API could be used.

Sure, the breaking changes in json-schema-validator apply to other aspects of the library, not used in NiFi. Thankfully, it looks like the only issue is the Schema URI references, which now appear to be aligned with the URI values from JSON Schema Specifications, which makes sense from an official alignment point of view.

@dan-s1
Copy link
Contributor Author

dan-s1 commented Feb 14, 2024

@exceptionfactory I wasn't sure though would this affect anyone who already is using the StandardJsonSchemaRegistry as the registry does store org.apache.nifi.json.schema.SchemaVersion objects.

@exceptionfactory
Copy link
Contributor

@exceptionfactory I wasn't sure though would this affect anyone who already is using the StandardJsonSchemaRegistry as the registry does store org.apache.nifi.json.schema.SchemaVersion objects.

Thanks for asking @dan-s1. Thankfully the StandardJsonSchemaRegistry does not use the URI for referencing the version, so just changing the URI value does not impact existing behavior.

Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks again for tracking down the required changes @dan-s1, looks good. +1 merging

exceptionfactory pushed a commit that referenced this pull request Feb 15, 2024
- Adjusted URIs for schemas Draft 4, Draft 6 and Draft 7 to match official values set on json-schema-validator 1.3.0

This closes #8405

Signed-off-by: David Handermann <exceptionfactory@apache.org>
(cherry picked from commit fd4a74d)
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