Validate compatible handlers have correct version#58304
Validate compatible handlers have correct version#58304pgomulka merged 7 commits intoelastic:compat_rest_apifrom
Conversation
Validating if registered compatible rest handlers are overriding compatibleWith method and specify the right compatible version
|
Pinging @elastic/es-core-infra (:Core/Infra/REST API) |
| ) { | ||
| if (Version.CURRENT.major == 8) { | ||
| return List.of( | ||
| return validatedList(7, |
There was a problem hiding this comment.
+1 to adding validation... I would have a minor preference to have a static validateCompatibleHandlers(Collection handlers) that is located in a more central location and that assumes Version.CURRENT.major - 1 to help make this more generic.
Also, I think normal IllegalStateException or the like may be preferable to the assert here.
There was a problem hiding this comment.
agree - IllegalStateException fits better here.
Also agree that this could be moved to some more generic place once we have more compat rest handlers in other modules. For the time being I would prefer to keep this in that class (as I don't know the right place since there are no more compat handlers in other modules yet)
Validating if registered compatible rest handlers are overriding
compatibleWith method and specify the right compatible version
("197 błędów / +197")