Skip to content

Commit

Permalink
hopefully better wording
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Valais <[email protected]>
  • Loading branch information
leovalais committed Jan 8, 2025
1 parent 81ffc41 commit adea77c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ We'll need a progressive migration as this implies too much change to fit in a s
4. Create a derive macro `ViewError` that interfaces with `thiserror::Error` API and generates:
* `impl ViewError`
* `impl utoipa::ToSchema` that returns the schema of the generated OSRD error
5. ~~Adapt the frontend error keys collection script to also look for errors in the OpenAPI routes response section.~~ We accept a temporary desync of the error keys.
5. We'll have to change the frontend error keys collection script almost entirely by the end of this migration. We could update it to also look for errors in the OpenAPI routes response section but that's extra work which brings little benefits. We accept a temporary desync of the error keys while this migration is ongoing.

We decide the status code of each `ViewError` at it's definition as it's a required data to generate the response (the status code is part of the payload). Duplicating it in the `utoipa::path` annotation is a bad idea, and extracting it from the generate `utoipa::Route` is tricky. Therefore the error has to stay the source of truth about its status code.

Expand Down

0 comments on commit adea77c

Please sign in to comment.