Skip to content

[HLRC] Ensure that response parsers support unknown fields #36938

Closed
@martijnvg

Description

@martijnvg

In the HLRC code response parsers using object parsers need to support handeling of unknown field. Otherwise a released HLRC may fail parsing responses from ES nodes released after it. All HLRC areas need to be checked.

After a quick check the follow hlrc areas use ConstructingObjectParser with ignoreUnknownFields flag set to false:

The following use old school parsing and will (likely) fail with unknown fields. FWIW, some of these are just a guess as to how bad they will behave.

  • bulk
  • getMapping (has some asserts, could fail)
  • snapshot.getRepository
  • license.get (just returns whatever json it gets, so its questionable)
  • security.putPrivileges

Disclaimer: It is possible that other old school parsers will quite easily bomb out given unknown fields. This list is likely not exhaustive depending on where the json fields are added.

Maybe we need make an automated check for this? (maybe forbidden apis that checks response classes in hlrc module only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions