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

Wrong code status in "Character" and "World" endpoints #311

Open
kamiljanek opened this issue Jan 9, 2024 · 2 comments
Open

Wrong code status in "Character" and "World" endpoints #311

kamiljanek opened this issue Jan 9, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers WIP Work in progress

Comments

@kamiljanek
Copy link

  1. Request /v4/world/{name} with not existing world return status code 400(Bad Request) instead of 404(Not Found)
    e.g. "https://api.tibiadata.com/v4/world/Anticaa"
    return:
{
  "information": {
    "api": {
      "version": 4,
      "release": "4.0.2",
      "commit": "ced9b5f8c1929c079756998f37a0f560bc643c2d"
    },
    "timestamp": "2024-01-09T11:09:50Z",
    "status": {
      "http_code": 400,
      "error": 11002,
      "message": "the provided world does not exist"
    }
  }
}
  1. Request /v4/character/{name} with not existing character return status code 502(Bad Gateway) instead of 404(Not Found)
    e.g. "https://api.tibiadata.com/v4/character/Trollefara"
    return:
{
  "information": {
    "api": {
      "version": 4,
      "release": "4.0.2",
      "commit": "ced9b5f8c1929c079756998f37a0f560bc643c2d"
    },
    "timestamp": "2024-01-09T11:11:31Z",
    "status": {
      "http_code": 502,
      "error": 20001,
      "message": "could not find character"
    }
  }
}
@kamiljanek kamiljanek changed the title Wrong code status in "Character" and "World" endpoints Wrong code status in "Character" and "World" endpoints -label:bug Jan 9, 2024
@kamiljanek kamiljanek changed the title Wrong code status in "Character" and "World" endpoints -label:bug Wrong code status in "Character" and "World" endpoints :bug Jan 9, 2024
@kamiljanek kamiljanek changed the title Wrong code status in "Character" and "World" endpoints :bug Wrong code status in "Character" and "World" endpoints Jan 9, 2024
@tobiasehlert tobiasehlert added the good first issue Good for newcomers label Jan 24, 2024
@tobiasehlert
Copy link
Member

hi @kamiljanek,

thanks for the issue and yes, that return code is not the ideal one for the two endpoints.

@phenpessoa created #309 which did cover a change, but since the change is a breaking change I postpone this for a release of an upcoming version (maybe closer to summer or so).

Kind regards,
Tobias

@tobiasehlert tobiasehlert self-assigned this Jan 24, 2024
@kamiljanek
Copy link
Author

hi @kamiljanek,

thanks for the issue and yes, that return code is not the ideal one for the two endpoints.

@phenpessoa created #309 which did cover a change, but since the change is a breaking change I postpone this for a release of an upcoming version (maybe closer to summer or so).

Kind regards, Tobias

good to know :) thanks

Pvmendes added a commit to Pvmendes/tibiadata-api-go that referenced this issue Mar 5, 2024
@tobiasehlert tobiasehlert added the WIP Work in progress label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers WIP Work in progress
Development

No branches or pull requests

2 participants