Skip to content

NIFI-15960 Replaced current property in AvroSchemaRegistry with a new one which utilizes a validation strategy where it details what Avro validations occur when choosing strict validation of Avro schemas.#11290

Open
dan-s1 wants to merge 5 commits into
apache:mainfrom
dan-s1:NIFI-15960

Conversation

@dan-s1
Copy link
Copy Markdown
Contributor

@dan-s1 dan-s1 commented May 27, 2026

Summary

NIFI-15960

This PR primarily details the various validations which occur when strict validation is chosen for validating Avro schemas in the AvroSchemaRegistry. The unit tests were overhauled to use the NIFI testing framework and multiple unit tests were added especially to contrast the difference between strict and lenient validation of Avro schemas.

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 contains commits signed with a registered key indicating Verified status

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 ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

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

}
}

config.removeProperty(obsoletePropertyName);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should removeProperty(obsoletePropertyName) be guarded by hasProperty(obsoletePropertyName) (or the loop broken after the first match), so that the migration result only reports the property that was actually present?

Copy link
Copy Markdown
Contributor Author

@dan-s1 dan-s1 Jun 1, 2026

Choose a reason for hiding this comment

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

Javadoc on remove is
Removes the property with the given name, if it exists. If the property does not exist, this is a no-op.

Why would it be necessary then to be guarded by hasProperty(obsoletePropertyName) (or the loop broken after the first match)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@pvillard31 Are you okay if this is left as is?

@dan-s1 dan-s1 requested a review from pvillard31 June 1, 2026 19:27
dan-s1 added 5 commits June 2, 2026 16:07
… one which utilizes a validation strategy where it details what Avro validations occur when choosing strict validation of Avro schemas.
…t what the Avro code actually does (i.e. validate or does not validate).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants