Git Product home page Git Product logo

Comments (5)

jacob-israel-turner avatar jacob-israel-turner commented on August 28, 2024 9

For a basic API (which SWAPI is), providing the URL is sufficient.

However, in a more powerful and complicated structure, having access to the id is crucial. For example, you could expand the functionality of your planets service. Maybe it could take an array of character IDs and return a list of all the planets those characters have every visited.

The ability to compose IDs with services is crucial in modern API architecture. A model shouldn't have to provide a URL for every place that it can be used.

This clearly isn't crucial for SWAPI. But I often use SWAPI when teaching developers to consume APIs. Having SWAPI act a bit more like the average API would definitely be helpful.

from swapi.

mbaas2 avatar mbaas2 commented on August 28, 2024 2

I'm currently implementing an APL-Wrapper for SWAPI and was surprised by the same.
I see the point about HATEOAS, but I'm also with @jacob-israel-turner on that ;)
Guess I will create the IDs myself from the URL then and provide a health-warning...

from swapi.

phalt avatar phalt commented on August 28, 2024 1

Why isn't the url sufficient enough? You would have to construct the URL anyway with the ID param? It's actually more HATEOAS (http://phalt.co/what-is-hateoas/) to use full URLs and not IDs :)

from swapi.

luismigil avatar luismigil commented on August 28, 2024

hi @mbaas2 , have you created the IDs from the URL parameter? I will be so thankfull if you can give me a snippet from your code.

Thanks!

from swapi.

mbaas2 avatar mbaas2 commented on August 28, 2024

@luismigil Sure, no problem: it's here.

from swapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.