1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src
Thomas Heartman 949a5f0109
fix: Update OpenAPI error converter to handle query param errors too (#7609)
This PR updates the OpenAPI error converter to also work for errors with
query parameters.
We previously only sent the body of the request along with the error,
which meant that query parameter errors would show up incorrectly.

For instance given a query param with the date format and the invalid
value `01-2020-01`, you'd previously get the message:
> The `from` value must match format "date". You sent undefined

With this change, you'll get this instead:
> The `from` value must match format "date". You sent "01-2020-01". 

The important changes here are two things:
- passing both request body and query params
- the 3 lines in `fromOpenApiValidationError` that check where we should
get the value you sent from.

The rest of it is primarily updating tests to send the right arguments
and some slight rewording to more accurately reflect that this can be
either request body or query params.
2024-07-17 12:47:32 +02:00
..
lib fix: Update OpenAPI error converter to handle query param errors too (#7609) 2024-07-17 12:47:32 +02:00
mailtemplates
migrations chore: db migration for integration events (#7604) 2024-07-17 10:02:04 +01:00
test feat: statistics for orphaned tokens (#7568) 2024-07-11 11:39:38 +02:00
migrator.ts
server-dev.ts chore: add integrationEvents feature flag (#7602) 2024-07-17 08:25:47 +01:00
server.ts