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

/api/<resource>/schema queries return 404 NOT FOUND error #37

Open
victormalets opened this issue Jun 19, 2021 · 3 comments
Open

/api/<resource>/schema queries return 404 NOT FOUND error #37

victormalets opened this issue Jun 19, 2021 · 3 comments

Comments

@victormalets
Copy link

victormalets commented Jun 19, 2021

Hello!

I've noticed that all /api//schema queries return the 404 NOT FOUND error.

For example, curl --location --request GET 'https://swapi.dev/api/people/schema' returns this body and 404th status code:

{
    "detail": "Not found"
}

This behavior is actual for all resources:

  • people
  • planets
  • films
  • species
  • vehicles
  • starships

I was hoping maybe you could help with that.

@sekunho
Copy link

sekunho commented Jan 20, 2022

I don't know why it's not working, but you can find the schema descriptions here: https://github.com/Juriy/swapi/tree/master/resources/schemas

@victormalets
Copy link
Author

I don't know why it's not working, but you can find the schema descriptions here: https://github.com/Juriy/swapi/tree/master/resources/schemas

Thank you!

corrni added a commit to corrni/swapi-browser that referenced this issue Aug 18, 2023
The `Film` and `Character` types were generated with an NPM package
(`json-schema-to-typescript`), using metadata from SWAPI.

While the schema endpoints are currently broken (see GitHub issue), the
relevant JSON schema files are readily available from the projects
repository (see links below).

I chose not to include the aforementioned NPM package because adding
any sort of codegen tooling felt like overkill :)

LINKS:
- Juriy/swapi#37 (GH issue outlining a problem
  with the `../<resource_name>/schema/` endpoints referred to in the
  SWAPI documentation)
- https://www.npmjs.com/package/json-schema-to-typescript (JSON schema
  to TypeScript transformer)
- https://github.com/phalt/swapi/tree/master/resources/schemas
  (where I got the SWAPI JSON schema files)
@bcr
Copy link

bcr commented Mar 4, 2024

I have created a Postman Star Wars API Collection that largely follows the Python unit tests. Can confirm, the /schema/ path for all of the entities does not work (returns 404.)

→ People Schema
  GET http://swapi.dev/api/people/schema/ [404 NOT FOUND, 311B, 407ms]
  1. Status code is 200

→ Species Schema
  GET http://swapi.dev/api/species/schema/ [404 NOT FOUND, 311B, 485ms]
  2. Status code is 200

→ Vehicles Schema
  GET http://swapi.dev/api/vehicles/schema/ [404 NOT FOUND, 311B, 418ms]
  3. Status code is 200

→ Starships Schema
  GET http://swapi.dev/api/starships/schema/ [404 NOT FOUND, 311B, 408ms]
  4. Status code is 200

→ Films Schema
  GET http://swapi.dev/api/films/schema/ [404 NOT FOUND, 311B, 401ms]
  5. Status code is 200

→ Planets Schema
  GET http://swapi.dev/api/planets/schema/ [404 NOT FOUND, 311B, 540ms]
  6. Status code is 200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants