Skip to content

celestix/telegraph-api-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

telegraph-api-spec

Introduction

This golang program generates a JSON description of methods, types and docstrings of the Telegraph API.

Features

  • Easy to generate, just build this Go program as usual and run.
  • JSON output stored as telegraph.json can be used to make autogenerated libraries for Telegraph API
  • Typo-Free: Since the JSON output is scraped from the official documentations, it won't be having in typo.

Example Output

{
  "methods": [
    {
      "name": "getPage",
      "description": "Use this method to get a Telegraph page. Returns a Page object on success.",
      "sample_request": "https://api.telegra.ph/getPage/Sample-Page-12-15?return_content=true",
      "parameters": [
        {
          "name": "path",
          "data_type": {
            "name": "String",
            "is_array": false
          },
          "required": true,
          "description": "Required. Path to the Telegraph page (in the format Title-12-31, i.e. everything that comes after http://telegra.ph/)."
        },
      ]
    },
  ],
  "types": [
    {
      "name": "PageViews",
      "description": "This object represents the number of page views for a Telegraph article.",
      "attributes": [
        {
          "name": "views",
          "data_type": {
            "name": "Integer",
            "is_array": false
          },
          "optional": false,
          "description": "Number of page views for the target page."
        }
      ]
    }
  ]
 } 

Disclaimer

Licensed Under GNU General Public License v3