question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include id for a given resource in list view

See original GitHub issue

For example, when querying /people, the individual records don’t have an id property, but this would be terribly useful and be in line with common RESTful api practice. It would be more useful for using SWAPI as a fake backend to test some front end functionality than simply relying on the url field.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:10
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
jacob-israel-turnercommented, Apr 20, 2017

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.

2reactions
mbaas2commented, Oct 8, 2019

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…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get the id resource id of a view in a List view
For your ListView , you can set an onItemClickListener as below ListView listView1 = (ListView) findViewById(R.id.listView1); listView1.
Read more >
List Views | REST API Developer Guide
Returns the list of list views for the specified sObject, including the ID and other basic information about each list view.
Read more >
Using lists in Android wth ListView - Tutorial - Vogella.com
To get the selected items of a ListView , use the getCheckedItemPosition() for a single selection method or listView.getCheckedItemPositions() for multiple ...
Read more >
Amazon Resource Names (ARNs) - AWS General Reference
The resource identifier. This is the name of the resource, the ID of the resource, or a resource path. Some resource identifiers include...
Read more >
PERMIT (Maintain resource access lists) - IBM
The conditional access list includes the user IDs and group names authorized to access the resource and the level of access granted to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found