Coder Social home page Coder Social logo

Comments (2)

bkeepers avatar bkeepers commented on June 6, 2024

I feel like I've seen some hypermedia-ish APIs (or recommendations in a blog post) that return an array of links, with a name and content-type for each link. It looked something like:

"links": [
  {
    "name": "self",
    "url": "https://github.com/exercism/test-maintainer-sync/pull/3",
    "content-type": "text/html"
  },
  {
    "name": "diff",
    "url": "https://github.com/exercism/test-maintainer-sync/pull/3.diff",
    "content-type": "text/plain"
  },
  {
    "name": "patch",
    "patch_url": "https://github.com/exercism/test-maintainer-sync/pull/3.patch",
    "content-type": "text/plain"
  },
  {
    "name": "issue",
    "url": "https://api.github.com/repos/exercism/test-maintainer-sync/issues/3",
    "content-type": "application/json"
  }
]

I don't remember where I saw this, but one thing that sticks out is that it makes it a lot harder to traverse urls (pr.diff_url vs iterating over links to find the one with the right name and content type).

With everything moving to GraphQL, I doubt it is worth spending much energy to improve the hypermedia support.

Anyway. I wonder if it would be useful to let people use the client to follow URLs.

One of the features I like of octokit.rb is that you can pass any of these URLs to Octokit.get, like Octokit.get(pr.patch_url)

from discussions.

kytrinyx avatar kytrinyx commented on June 6, 2024

With everything moving to GraphQL, I doubt it is worth spending much energy to improve the hypermedia support.

That is a good point.

One of the features I like of octokit.rb is that [...]

I had no idea! That's really useful. In fact, this would be a nice standard thing to support across clients, if it's not a hassle.

from discussions.

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.