Skip to content

Add schemaPath to ValidationMessage.#552

Merged
stevehu merged 1 commit intonetworknt:masterfrom
EvanZhang008:master
Apr 9, 2022
Merged

Add schemaPath to ValidationMessage.#552
stevehu merged 1 commit intonetworknt:masterfrom
EvanZhang008:master

Conversation

@EvanZhang008
Copy link
Contributor

@stevehu stevehu merged commit 7e9375f into networknt:master Apr 9, 2022
}

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