Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:30:13+00:00 2026-06-05T11:30:13+00:00

Suppose we have a rest API to get back some items located at /items

  • 0

Suppose we have a rest API to get back some items located at /items which returns a JSON array like so

[ {....},{...},{...} .... {...}]

suppose that items/{id} returns the representation of the item with id {id}

to get to item 4 it is possible to do it in two ways:

Case 1: get /items and then search the response for an item with id #4

Case 2: get /item/4

should the representation to returned by case 1 be identical as the representation returned by case 2?

EDIT 1 for example /dogs could return an array of dog resources where only the name and the id are populated and /dogs/4 could return full details for a dog resource.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:30:14+00:00Added an answer on June 5, 2026 at 11:30 am

    Short answer

    You can return different structures from Collection and from Model.

    Long answer

    You can return in your JSON whatever you want, Backbone will build an entity of your Model using the data provided by the JSON, Backbone will adapt the created instance to the data provided, merging it with the declared Model.defaults.

    You can even, for example, return different JSON structure for this two queries:

    • /dogs/1
    • /dogs/2

    I understand your concern, you are trying to fetch a bunch of objects with very low data detail and then fetch the full data for a concrete instance when is needed.

    I don’t see any problem on it.

    Try to mark your uncompleted Models to not using them in the detailing Views without fetching the whole data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a ASP.NET Web API controller that uses a service, which in
Suppose I have an integer array like this: {5,3,5,4,2} and I have a method
Suppose I have a search screen that is intended for looking up items. There
Suppose I have an IQueryable<T> expression that I'd like to encapsulate the definition of,
I have the following REST API: POST /users/martin/notify/... The API is suppose to notify
I'd suppose there is some sort of MySQL REST API or a processor included
I have a Grails app running on 1.3.7 with the json-rest-api plugin version 1.0.8
Suppose I have 2 servers. The first is a service that provides some computations,
Lets suppose I have a RESTful service which has a list of tasks. GET
Suppose I have a string which contains an HTML file. How do I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.