PrzypisPowszechny / pp-client

7 stars 2 forks source link

Auto-generate JSON schema #315

Open glowka opened 5 years ago

glowka commented 5 years ago

Like that:

{
  "tabs": {
    "2": {
      "tabInfo": {
        "currentUrl": "https://www.polskieradio.pl/13/53/Artykul/2175283,Sygnaly-Dnia-6-sierpnia-2018-roku-rozmowa-z-Andrzejem-Halickim"
      },
      "api": {
        "annotations": {
          "data": [
            {
              "id": "2",
              "type": "annotations",
              "links": {
                "self": "http://localhost:8000/api/annotations/2"
              },
              "attributes": {
                "url": "https://www.polskieradio.pl/13/53/Artykul/2175283,Sygnaly-Dnia-6-sierpnia-2018-roku-rozmowa-z-Andrzejem-Halickim",
                "range": null,
                "quote": "Jeżeli policjant (to jest ustawa o Policji) dostanie od przełożonego rozkaz, który jest sprzeczny z prawem, ma obowiązek, nie tylko powinien, ale ma obowiązek odmówić wykonania rozkazu.",
                "quoteContext": "",
                "publisher": "DEMAGOG",
                "ppCategory": "ADDITIONAL_INFO",
                "demagogCategory": "TRUE",
                "comment": "",
                "annotationLink": "http://demagog.org.pl/wypowiedzi/andrzej-halicki-w-sygnalach-dnia/",
                "annotationLinkTitle": "demagog.org.pl",
                "createDate": "2019-02-24T13:00:55.415493Z",
                "upvoteCountExceptUser": 0,
                "doesBelongToUser": false
              },
              "relationships": {
                "user": {
                  "data": {
                    "type": "users",
                    "id": "1"
                  },
                  "links": {
                    "related": "http://localhost:8000/api/annotations/2/user"
                  }
                },
                "annotationUpvote": {
                  "data": null,
                  "links": {
                    "related": "http://localhost:8000/api/annotations/2/upvote"
                  }
                },
                "annotationReports": {
                  "data": [],
                  "links": {
                    "related": "http://localhost:8000/api/annotations/2/reports"
                  }
                }
              }
            }
          ]
        },
        "annotationUpvotes": {
          "data": []
        },
        "isCreating": 0,
        "isReading": 0,
        "isUpdating": 0,
        "isDeleting": 0,
        "endpoint": {
          "axiosConfig": {
            "baseURL": "http://localhost:8000/api",
            "withCredentials": true
          }
        }
      },
      "annotations": {
        "hasLoaded": true,
        "located": [
          {
            "annotationId": "2",
            "range": {
              "start": "/div[2]/form[1]/div[3]/div[3]/div[3]/div[1]/div[2]/div[1]/article[1]/div[1]/div[3]/span[1]/p[12]",
              "startOffset": 294,
              "end": "/div[2]/form[1]/div[3]/div[3]/div[3]/div[1]/div[2]/div[1]/article[1]/div[1]/div[3]/span[1]/p[12]",
              "endOffset": 479
            }
          }
        ],
        "unlocated": []
      },
      "appModes": {
        "isExtensionDisabled": false,
        "annotationModePages": [],
        "requestModePages": [],
        "disabledPages": [],
        "requestModeFormData": {}
      },
      "widgets": {
        "menu": {
          "visible": false,
          "location": {
            "x": 0,
            "y": 0
          }
        },
        "viewer": {
          "visible": false,
          "location": {
            "x": 0,
            "y": 0
          },
          "deleteModal": {},
          "viewerItems": []
        },
        "editor": {
          "annotationId": null,
          "range": null,
          "visible": false,
          "location": {
            "x": 0,
            "y": 0
          }
        },
        "notification": {
          "visible": false
        }
      },
      "textSelector": {
        "range": null
      }
    }
  },
  "storage": {
    "isHydrated": true,
    "value": {
      "auth": {
        "access": "...",
        "refresh": "...",
        "userId": "...@gmail.com"
      }
    }
  }
}