Coder Social home page Coder Social logo

API Documentation missing about sarala HOT 4 OPEN

Garanaw avatar Garanaw commented on August 26, 2024
API Documentation missing

from sarala.

Comments (4)

milroyfraser avatar milroyfraser commented on August 26, 2024 1

Hi @Garanaw,

According to JSON:API spec in api response data.relationships should only contain reference objects. And data belongs to relationships should go inside included

https://laravel-news.com/json-api-introduction

Best,

from sarala.

Garanaw avatar Garanaw commented on August 26, 2024

@milroyfraser That's great, finally I got the right format. Thanks! Might I suggest to add this page as well as other links I've seen in other issues to a wiki page as a reference? That'd save us time trying to find some documentation, and some of the time you spend answering this kind of questions too.
Again, thank you.

P.S. Issue ready to be closed if you agree

from sarala.

Garanaw avatar Garanaw commented on August 26, 2024

@milroyfraser Again struggling with relationships, collections this time. I followed the exact format shown in the link above (literally copy/paste the example), yet the formatter complains about "data is undefined". It works fine with a single item in the relationships/included fields ( 'included' => ['includedItem' => new Resource($item)] ).

Any specific format for this use case?

Thank you

from sarala.

aidan-casey avatar aidan-casey commented on August 26, 2024

Hi @Garanaw, I cannot speak for the author, but I think this package assumes a familiarity with the JSON:API specification, so that kind of documentation doesn't really belong here.

That said, so you aren't repeating work that's already been done, I highly recommend you check out CloudCreativity's Laravel-JSON-API package for Laravel. It is an extensive package that implements the best practices descriped by that JSON:API spec.

from sarala.

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.