Code Monkey home page Code Monkey logo

Comments (11)

jokeyrhyme avatar jokeyrhyme commented on June 13, 2024

For clarity, is this for requests like: GET /api/v1/author/123?include=books ?
This would be as per http://jsonapi.org/format/ "Inclusion of Related Documents" ?

from fortune.

jokeyrhyme avatar jokeyrhyme commented on June 13, 2024

@benbarclay may be interested in this...

from fortune.

gr0uch avatar gr0uch commented on June 13, 2024

Yeah. I opened this issue before that syntax became part of the spec, so I think that it would make sense to omit related resources unless it is requested.

from fortune.

benbarclay avatar benbarclay commented on June 13, 2024

Interesting. I hadn't noticed the addition of Compound Documents to the
spec.

I agree that it would be really useful to include.

I know I have one or two examples where I do lookups three levels deep,
based on parent -> child relationships.

Not sure how the spec handles data being nested several levels deep. It
would being a useful thing to at least think through.

I agree with omitting related resources unless requested. As a default, it
saves bandwidth and it also maintains backward compatability.

On Monday, 9 December 2013, Dali Zheng wrote:

Yeah. I opened this issue before that syntax became part of the spec, so I
think that it would make sense to omit related resources unless it is
requested.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-30102501
.

from fortune.

gr0uch avatar gr0uch commented on June 13, 2024

@benbarclay the issue of links to nested compound documents was recently brought up over there: json-api/json-api#170

from fortune.

jokeyrhyme avatar jokeyrhyme commented on June 13, 2024

Should fortune automatically output the "links" metadata describing which linked fields point to which resource types (as per the examples in json-api/json-api#170 ) ?

from fortune.

gr0uch avatar gr0uch commented on June 13, 2024

Yep. It currently already does that, just not for compound documents yet: https://github.com/daliwali/fortune/blob/master/lib/route.js#L503

from fortune.

creativeaura avatar creativeaura commented on June 13, 2024

Is is possible to include the related resource using GET method. I tried it with a simple example but it only includes id's not complete resources. Also if we can use ?include=resource then using fortunejs will make alot of sense for most rest api.

from fortune.

deini avatar deini commented on June 13, 2024

Any updates on this? :)

from fortune.

gr0uch avatar gr0uch commented on June 13, 2024

It's in the rewrite, I'm planning on supporting every optional part of the spec (MAYs and SHOULDs). The way it works is just as described in the spec, using the ?include= query.

from fortune.

deini avatar deini commented on June 13, 2024

Awesome. Being able to get full resources by ?include=resource like @creativeaura said would be useful.

from fortune.

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.