Git Product home page Git Product logo

hal-jsonapi-comparison's Introduction

HAL & JSON API Comparison

Mocks of selected REST endpoints to compare HAL and JSON API

This repository contains a few endpoints mocked out in both HAL and JSON API to be able to compare them in order to choose a format for the DSpace 7 REST API

JSON API

  • Responses to a GET on the following endpoints:
  • Inclusion of Related Resources: A request to fetch everything needed to render an item view page would look similar to this:
    • /items/21539b1d-9ef1-4eda-9c77-49565b5bfb78?include=collections,bundles,bundles.bitstreams&fields[collections]=name,handle
      • This GETs the item with id 21539b1d-9ef1-4eda-9c77-49565b5bfb78
      • and asks to include its collections :include=collections…
      • to include the item's bundles: include=…,bundles…
      • to include the bitstreams of those bundles: include=…,bundles.bitstreams
      • and for collections to only include the fields name and handle, for use in the trail for example: &fields[collections]=name,handle
    • response
  • Errors:
    • This is a response that could be returned for an item submission that doesn't contain a title, but does contain a value for dc.contributor.assistant, a field that isn't defined on the server
  • Pagination:
    • This is a response that could be returned for a paginated item list
    • /items?page[number]=7&page[size]=2&fields[items]=name,handle
      • page[number]=7: ask for page 7
      • page[size]=2: 2 results per page
      • fields[items]=name,handle: only return the name and the handle of each item

hal-jsonapi-comparison's People

Contributors

abollini avatar artlowel avatar jcreel avatar tdonohue avatar

Watchers

 avatar  avatar

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.