Skip to content

Add schemaPath to ValidationMessage. #552

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

Merged
merged 1 commit into from
Apr 9, 2022

Conversation

EvanZhang008
Copy link
Contributor

@stevehu stevehu merged commit 7e9375f into networknt:master Apr 9, 2022
@@ -113,17 +130,17 @@ public void setType(String type) {
this.type = type;
}

public static ValidationMessage of(String type, ErrorMessageType errorMessageType, String at, String... arguments) {
public static ValidationMessage of(String type, ErrorMessageType errorMessageType, String at, String schemaPath, String... arguments) {

Choose a reason for hiding this comment

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

This is a breaking change, this should at least have been a bump of the minor version!

What's even worse, with the rest arguments parameter also being of the same type (String), any call to ValidationMessage.of that includes at least one argument silently shifts the first rest argument to become the schemaPath instead. No compiler warnings or anything to help detect this. Since this requires a manual search, I feel the changelog entry could have been a bit more detailed about this too.

I had some fun finding this out going from 1.0.681.0.69, I was lucky to have a test fail on it to detect the arguments shift…

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.

3 participants