mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
This PR uses [conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to allow the handling of both multiple API versions within one route handler. The more tricky bit turned out to be not the updated request body, but the response since it is an NDJSON stream where some messages were updated. In this case also the functions that create these messages were updated with conditional types to be able to create a message that fits the definition of the API version. The API integration tests originally had these message identifiers in the `expected` section of their `testData`. I changed that to use helper functions that retrieve the expected messages from the stream according to the expected version. All API integration tests are run on both versions. The functional tests are run only on the newer version since the UI is expected to work with version `2` only. |
||
---|---|---|
.. | ||
apis | ||
config.ts | ||
ftr_provider_context.d.ts |