Coder Social home page Coder Social logo

petersolopov / json-api-debugger Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 1.75 MB

JSON API debugger chrome extension

Home Page: https://chrome.google.com/webstore/detail/json-api-debugger/cegnaocdodcebnffemedooiknbljkacl

HTML 1.51% JavaScript 98.49%
chrome-extension chrome json-api

json-api-debugger's Introduction

JSON API debugger chrome extension Build Status

JSON API is a specification for building APIs detailed at JSONAPI.org.

Install

Install it from Chrome Web Store

Motivation

JSON API is quite verbose and it is hard to view big responses with many nested includes e.g. include=foo.bar.baz.

Solution

It would be nice to view in console the deserialized structure of JSON API response. It is a simple object converted from JSON.

JSON API response
{
  "data": [
    {
      "id": "1",
      "type": "town",
      "attributes": {
        "name": "Moscow"
      },
      "relationships": {
        "region": {
          "data": {
            "id": "2",
            "type": "region"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "2",
      "type": "region",
      "attributes": {
        "name": "Moscow region"
      },
      "relationships": {
        "country": {
          "data": {
            "id": "3",
            "type": "country"
          }
        }
      }
    },
    {
      "id": "3",
      "type": "country",
      "attributes": {
        "name": "Russia"
      }
    }
  ]
}
Deserialized structure
{
  data: [
    {
      id: "1",
      type: "town",
      name: "Moscow",
      region: {
        id: "2",
        type: "region",
        name: "Moscow region",
        country: {
          id: "3",
          type: "country",
          name: "Russia"
        },
      }
    }
  ]
};

Supports

Google Chrome 60+

Usage

  1. Install extension
  2. Add rule (regexp) in options for your JSON API endpoint to catch it
  3. View data in console (deserialized response, query info, etc.)

Building for use

Download the source code

  1. Install dependencies npm install
  2. Zip chrome extension npm run build

This will generate json_api_debugger.zip for use in Chromium browsers.

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.