Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow HTTP 404 Error Codes when providing the wrong API Version HTTP Header #543

Open
zerwuff opened this issue Apr 2, 2024 · 1 comment
Assignees
Labels
WT1 To be discussed at the next meeting
Milestone

Comments

@zerwuff
Copy link

zerwuff commented Apr 2, 2024

Is your feature request related to a problem? Please describe.

feature request

When a MP call any of our TO endpoints, e.g. Post Leg events on a booking - or any other except the meta endpoint - he has to provide the TOMP API version as required HTTP parameter.
In our standard spring boot implementation, version and path describes an unique resource. Following this logic, omitting the API version would then be a HTTP 404 response to the MP rather than the nearest by TOMP spec possible HTTP 400.

Urgency

minor, since we can build workarounds to provide a HTTP 400

Additional context

required HTTP parameter "API Version" is provided, but no corresponding version can be found. All requests, except meta endpoint

Describe the solution you'd like

Add HTTP 404 as valid HTTP error in addition to now existing 400,401,403

Describe alternatives you've considered

Make the API returning a 400 HTTP, but this is weird - knowing that the provided version semantically is correct (e.g. 1.5.0) , but the API backend has no such version (>=maybe 1.6.0), making it not so hard to understand that the parameter itself is "correct" but the backend would just not serve that specific version.

Possible Implementation

Allow 404 as additional error code

@edwinvandenbelt edwinvandenbelt added the WT1 To be discussed at the next meeting label Apr 10, 2024
@edwinvandenbelt edwinvandenbelt added this to the 1.6 milestone Apr 10, 2024
@edwinvandenbelt edwinvandenbelt moved this to To do in WT1 Kanban Jun 5, 2024
@edwinvandenbelt edwinvandenbelt self-assigned this Dec 19, 2024
@edwinvandenbelt edwinvandenbelt modified the milestones: 1.6, 2.0 Dec 19, 2024
@edwinvandenbelt
Copy link
Collaborator

In v2.0, all codes are allowed (using 'default' keyword), example:

    responses:
        "200":
          description: successful operation
          headers:
            Content-Language:
              $ref: "#/components/headers/contentLanguage"
            Version:
              $ref: "#/components/headers/version"
...
       default:
          $ref: "#/components/responses/errorResponse"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WT1 To be discussed at the next meeting
Projects
Status: To do
Development

No branches or pull requests

2 participants