github.com/sanposhiho/openapi2proto@v0.0.0-20230521044535-d1080a134e37/fixtures/most_popular.json (about)

     1  
     2  {
     3      "swagger": "2.0",
     4      "schemes": [
     5          "http",
     6          "https"
     7      ],
     8      "basePath": "/svc/mostpopular/v2",
     9      "host": "api.nytimes.com",
    10      "info": {
    11          "version": "2.0.0",
    12          "title": "The Most Popular API",
    13          "description": "## Welcome\n\nThis is a place to put general notes and extra information, for internal use.\n\nTo get started designing/documenting this API, select a version on the left."
    14      },
    15      "produces": [
    16          "application/json"
    17      ],
    18      "paths": {
    19          "/mostshared/{section}/{time-period}.json": {
    20              "parameters": [
    21                  {
    22                      "name": "section",
    23                      "in": "path",
    24                      "required": true,
    25                      "type": "string"
    26                  },
    27                  {
    28                      "name": "time-period",
    29                      "in": "path",
    30                      "required": true,
    31                      "type": "string"
    32                  }
    33              ],
    34              "get": {
    35                  "summary": "Most Shared by Section & Time Period",
    36                  "description": "",
    37                  "operationId": "GET_mostshared-section-time-period-json",
    38                  "consumes": [
    39                      "application/json"
    40                  ],
    41                  "produces": [
    42                      "application/json"
    43                  ],
    44                  "parameters": [
    45                      {
    46                          "name": "api-key",
    47                          "in": "query",
    48                          "type": "string"
    49                      }
    50                  ],
    51                  "responses": {
    52                      "200": {
    53                          "description": "An array of Articles",
    54                          "schema": {
    55                              "type": "object",
    56                              "properties": {
    57                                  "status": {
    58                                      "type": "string"
    59                                  },
    60                                  "copyright": {
    61                                      "type": "string"
    62                                  },
    63                                  "num_results": {
    64                                      "type": "integer"
    65                                  },
    66                                  "results": {
    67                                      "type": "array",
    68                                      "items": {
    69                                          "$ref": "#/definitions/Article"
    70                                      }
    71                                  }
    72                              }
    73                          },
    74                          "examples": {
    75                              "application/json": {
    76                                  "status": "OK",
    77                                  "copyright": "Copyright (c) 2016 The New York Times Company.  All Rights Reserved.",
    78                                  "results": [
    79                                      {
    80                                          "url": "http://www.nytimes.com/2016/02/18/technology/apple-timothy-cook-fbi-san-bernardino.html",
    81                                          "column": "",
    82                                          "section": "Technology",
    83                                          "byline": "By ERIC LICHTBLAU and KATIE BENNER",
    84                                          "title": "Apple Fights Order to Unlock San Bernardino Gunman’s iPhone",
    85                                          "abstract": "Timothy D. Cook, Apple’s chief, said the government’s request to bypass security on the phone used by Syed Rizwan Farook had “chilling” implications.",
    86                                          "published_date": "2016-02-18",
    87                                          "source": "The New York Times",
    88                                          "asset_id": 100000004214575,
    89                                          "total_shares": 1,
    90                                          "des_facet": [
    91                                              "IPHONE"
    92                                          ],
    93                                          "org_facet": [
    94                                              "APPLE INC"
    95                                          ],
    96                                          "per_facet": [
    97                                              "COOK, TIMOTHY D"
    98                                          ],
    99                                          "geo_facet": "",
   100                                          "media": [
   101                                              {
   102                                                  "type": "image",
   103                                                  "subtype": "photo",
   104                                                  "caption": "Timothy D. Cook, the chief executive of Apple, released a letter to customers several hours after a California judge ordered the company to unlock an iPhone used by one of the shooters in a recent attack that killed 14 people in San Bernardino.",
   105                                                  "copyright": "Jeff Chiu/Associated Press",
   106                                                  "media-metadata": [
   107                                                      {
   108                                                          "url": "http://static01.nyt.com/images/2016/02/18/world/18Appleletter-web/18Appleletter-web-thumbStandard.jpg",
   109                                                          "format": "Standard Thumbnail",
   110                                                          "height": 75,
   111                                                          "width": 75
   112                                                      }
   113                                                  ]
   114                                              }
   115                                          ]
   116                                      }
   117                                  ],
   118                                  "num_results": 24
   119                              }
   120                          }
   121                      },
   122                      "400": {
   123                          "description": "",
   124                          "schema": {
   125                              "type": "object",
   126                              "properties": {
   127                                  "status": {
   128                                      "type": "string"
   129                                  },
   130                                  "copyright": {
   131                                      "type": "string"
   132                                  },
   133                                  "errors": {
   134                                      "type": "array",
   135                                      "items": {
   136                                          "type": "string"
   137                                      }
   138                                  },
   139                                  "results": {
   140                                      "type": "array",
   141                                      "items": {}
   142                                  }
   143                              }
   144                          },
   145                          "examples": {
   146                              "application/json": {
   147                                  "status": "ERROR",
   148                                  "copyright": "Copyright (c) 2016 The New York Times Company.  All Rights Reserved.",
   149                                  "errors": [
   150                                      "Please specify a supported period, options are: 1,7,30"
   151                                  ],
   152                                  "results": []
   153                              }
   154                          }
   155                      }
   156                  },
   157                  "security": [
   158                      {
   159                          "api-key": []
   160                      }
   161                  ]
   162              }
   163          },
   164          "/mostemailed/{section}/{time-period}.json": {
   165              "parameters": [
   166                  {
   167                      "name": "section",
   168                      "in": "path",
   169                      "required": true,
   170                      "type": "string"
   171                  },
   172                  {
   173                      "name": "time-period",
   174                      "in": "path",
   175                      "required": true,
   176                      "type": "string"
   177                  }
   178              ],
   179              "get": {
   180                  "summary": "Most Emailed by Section & Time Period",
   181                  "description": "",
   182                  "operationId": "GET_mostemailed-section-time-period-json",
   183                  "consumes": [
   184                      "application/json"
   185                  ],
   186                  "produces": [
   187                      "application/json",
   188                      "application/xml"
   189                  ],
   190                  "parameters": [
   191                      {
   192                          "name": "api-key",
   193                          "in": "query",
   194                          "type": "string"
   195                      },
   196                      {
   197                          "name": "Accept",
   198                          "in": "header",
   199                          "description": "",
   200                          "type": "string"
   201                      }
   202                  ],
   203                  "responses": {
   204                      "200": {
   205                          "description": "An array of Articles",
   206                          "schema": {
   207                              "type": "object",
   208                              "properties": {
   209                                  "status": {
   210                                      "type": "string"
   211                                  },
   212                                  "copyright": {
   213                                      "type": "string"
   214                                  },
   215                                  "num_results": {
   216                                      "type": "integer"
   217                                  },
   218                                  "results": {
   219                                      "type": "array",
   220                                      "items": {
   221                                          "$ref": "#/definitions/ArticleWithCountType"
   222                                      }
   223                                  }
   224                              }
   225                          }
   226                      },
   227                      "400": {
   228                          "description": "",
   229                          "schema": {
   230                              "type": "object",
   231                              "properties": {
   232                                  "status": {
   233                                      "type": "string"
   234                                  },
   235                                  "copyright": {
   236                                      "type": "string"
   237                                  },
   238                                  "errors": {
   239                                      "type": "array",
   240                                      "items": {
   241                                          "type": "string"
   242                                      }
   243                                  },
   244                                  "results": {
   245                                      "type": "array",
   246                                      "items": {}
   247                                  }
   248                              }
   249                          },
   250                          "examples": {
   251                              "application/json": {
   252                                  "status": "ERROR",
   253                                  "copyright": "Copyright (c) 2016 The New York Times Company.  All Rights Reserved.",
   254                                  "errors": [
   255                                      "Param 'period' is invalid."
   256                                  ],
   257                                  "results": []
   258                              }
   259                          }
   260                      },
   261                      "403": {
   262                          "description": "",
   263                          "schema": {
   264                              "type": "object"
   265                          },
   266                          "examples": {
   267                              "application/xml": "<h1>Developer Over Qps</h1>"
   268                          }
   269                      }
   270                  },
   271                  "security": [
   272                      {
   273                          "api-key": []
   274                      }
   275                  ]
   276              }
   277          },
   278          "/mostviewed/{section}/{time-period}.json": {
   279              "parameters": [],
   280              "get": {
   281                  "summary": "Most Viewed by Section & Time Period",
   282                  "description": "",
   283                  "operationId": "GET_mostviewed-section-time-period-json",
   284                  "consumes": [
   285                      "application/json"
   286                  ],
   287                  "produces": [
   288                      "application/json"
   289                  ],
   290                  "parameters": [
   291                      {
   292                          "name": "Accept",
   293                          "in": "header",
   294                          "description": "",
   295                          "type": "string"
   296                      }
   297                  ],
   298                  "responses": {
   299                      "200": {
   300                          "description": "An array of Articles",
   301                          "schema": {
   302                              "type": "object",
   303                              "properties": {
   304                                  "status": {
   305                                      "type": "string"
   306                                  },
   307                                  "copyright": {
   308                                      "type": "string"
   309                                  },
   310                                  "num_results": {
   311                                      "type": "integer"
   312                                  },
   313                                  "results": {
   314                                      "type": "array",
   315                                      "items": {
   316                                          "$ref": "#/definitions/Article"
   317                                      }
   318                                  }
   319                              }
   320                          },
   321                          "examples": {
   322                              "application/json": {
   323                                  "status": "OK",
   324                                  "copyright": "Copyright (c) 2016 The New York Times Company.  All Rights Reserved.",
   325                                  "num_results": 121,
   326                                  "results": [
   327                                      {
   328                                          "url": "http://www.nytimes.com/2016/02/25/opinion/senate-republicans-lose-their-minds-on-a-supreme-court-seat.html",
   329                                          "adx_keywords": "Supreme Court (US);McConnell, Mitch;Scalia, Antonin;Obama, Barack;Kirk, Mark Steven;Republican Party;Senate;Cornyn, John;Collins, Susan M",
   330                                          "column": "Editorial",
   331                                          "section": "Opinion",
   332                                          "byline": "By THE EDITORIAL BOARD",
   333                                          "type": "Article",
   334                                          "title": "Senate Republicans Lose Their Minds on a Supreme Court Seat",
   335                                          "abstract": "Republicans have parked themselves so far to the right for so many years that it’s not clear if they can hear how deranged they sound.",
   336                                          "published_date": "2016-02-25",
   337                                          "source": "The New York Times",
   338                                          "id": 100000004229487,
   339                                          "asset_id": 100000004229487,
   340                                          "views": 1,
   341                                          "des_facet": "",
   342                                          "org_facet": [
   343                                              "SUPREME COURT (US)"
   344                                          ],
   345                                          "per_facet": [
   346                                              "MCCONNELL, MITCH"
   347                                          ],
   348                                          "geo_facet": "",
   349                                          "media": ""
   350                                      }
   351                                  ]
   352                              }
   353                          }
   354                      }
   355                  },
   356                  "security": [
   357                      {
   358                          "api-key": []
   359                      }
   360                  ]
   361              }
   362          }
   363      },
   364      "definitions": {
   365          "GeoFacet": {
   366              "type": "object",
   367              "properties":{
   368                  "type":{
   369                      "type":"string"
   370                  }
   371              }
   372          },
   373          "PerFacet": {
   374              "type": "object",
   375              "properties":{
   376                  "type":{
   377                      "type":"string"
   378                  }
   379              }
   380          },
   381          "OrgFacet": {
   382              "type": "object",
   383              "properties":{
   384                  "type":{
   385                      "type":"string"
   386                  }
   387              }
   388          },
   389          "DesFacet": {
   390              "type": "object",
   391              "properties":{
   392                  "type":{
   393                      "type":"string"
   394                  }
   395              }
   396          },
   397          "TimePeriod": {
   398              "in": "path",
   399              "description": "Number of days `1 | 7 | 30 ` corresponds to a day, a week, or a month of content.",
   400              "type": "string",
   401              "enum": [
   402                  "1",
   403                  "7",
   404                  "30"
   405              ]
   406          },
   407          "SharedTypes": {
   408              "in": "query",
   409              "description": "Limits the results by the method used to share the items only works on mostshared requests.",
   410              "type": "string",
   411              "enum": [
   412                  "digg",
   413                  "email",
   414                  "facebook",
   415                  "mixx",
   416                  "myspace",
   417                  "permalink",
   418                  "timespeople",
   419                  "twitter",
   420                  "yahoobuzz"
   421              ]
   422          },
   423          "Article": {
   424              "type": "object",
   425              "properties": {
   426                  "url": {
   427                      "type": "string"
   428                  },
   429                  "column": {
   430                      "type": "string"
   431                  },
   432                  "section": {
   433                      "type": "string"
   434                  },
   435                  "byline": {
   436                      "type": "string"
   437                  },
   438                  "title": {
   439                      "type": "string"
   440                  },
   441                  "abstract": {
   442                      "type": "string"
   443                  },
   444                  "published_date": {
   445                      "type": "string"
   446                  },
   447                  "source": {
   448                      "type": "string"
   449                  },
   450                  "des_facet": {
   451                      "$ref": "#/definitions/DesFacet"
   452                  },
   453                  "org_facet": {
   454                      "$ref": "#/definitions/OrgFacet"
   455                  },
   456                  "per_facet": {
   457                      "$ref": "#/definitions/PerFacet"
   458                  },
   459                  "geo_facet": {
   460                      "$ref": "#/definitions/GeoFacet"
   461                  },
   462                  "media": {
   463                      "type": [
   464                          "array",
   465                          "string"
   466                      ],
   467                      "items": {}
   468                  }
   469              }
   470          },
   471          "ArticleWithCountType": {
   472              "type": "object",
   473              "properties": {
   474                  "url": {
   475                      "type": "string"
   476                  },
   477                  "count_type": {
   478                      "type": "string"
   479                  },
   480                  "column": {
   481                      "type": "string"
   482                  },
   483                  "section": {
   484                      "type": "string"
   485                  },
   486                  "byline": {
   487                      "type": "string"
   488                  },
   489                  "title": {
   490                      "type": "string"
   491                  },
   492                  "abstract": {
   493                      "type": "string"
   494                  },
   495                  "published_date": {
   496                      "type": "string"
   497                  },
   498                  "source": {
   499                      "type": "string"
   500                  },
   501                  "des_facet": {
   502                      "$ref": "#/definitions/DesFacet"
   503                  },
   504                  "org_facet": {
   505                      "$ref": "#/definitions/OrgFacet"
   506                  },
   507                  "per_facet": {
   508                      "$ref": "#/definitions/PerFacet"
   509                  },
   510                  "geo_facet": {
   511                      "$ref": "#/definitions/GeoFacet"
   512                  },
   513                  "media": {
   514                      "type": "array",
   515                      "x-runscope/nullable": true,
   516                      "x-runscope/nullable/value": "''",
   517                      "items": {
   518                          "type": "object",
   519                          "properties": {
   520                              "type": {
   521                                  "type": "string"
   522                              },
   523                              "subtype": {
   524                                  "type": "string"
   525                              },
   526                              "caption": {
   527                                  "type": "string"
   528                              },
   529                              "copyright": {
   530                                  "type": "string"
   531                              },
   532                              "media-metadata": {
   533                                  "type": "object",
   534                                  "properties": {
   535                                      "url": {
   536                                          "type": "string"
   537                                      },
   538                                      "format": {
   539                                          "type": "string"
   540                                      },
   541                                      "height": {
   542                                          "type": "integer"
   543                                      },
   544                                      "width": {
   545                                          "type": "integer"
   546                                      }
   547                                  }
   548                              }
   549                          }
   550                      }
   551                  }
   552              }
   553          },
   554          "Section": {
   555              "in": "path",
   556              "description": "Limits the results by one or more sections. You can use\n`all-sections` or one or more section names seperated by semicolons. See `viewed/sections.json` call to get a list of sections. \n",
   557              "type": "string",
   558              "enum": [
   559                  "Arts",
   560                  "Automobiles",
   561                  "Blogs",
   562                  "Books",
   563                  "Business Day",
   564                  "Education",
   565                  "Fashion & Style",
   566                  "Food",
   567                  "Health",
   568                  "Job Market",
   569                  "Magazine",
   570                  "membercenter",
   571                  "Movies",
   572                  "Multimedia",
   573                  "N.Y.%20%2F%20Region",
   574                  "NYT Now",
   575                  "Obituaries",
   576                  "Open",
   577                  "Opinion",
   578                  "Public Editor",
   579                  "Real Estate",
   580                  "Science",
   581                  "Sports",
   582                  "Style",
   583                  "Sunday Review",
   584                  "T Magazine",
   585                  "Technology",
   586                  "The Upshot",
   587                  "Theater",
   588                  "Times Insider",
   589                  "Today’s Paper",
   590                  "Travel",
   591                  "U.S.",
   592                  "World",
   593                  "Your Money",
   594                  "all-sections"
   595              ]
   596          },
   597          "OffSet": {
   598              "in": "query",
   599              "description": "Positive integer in a multiple of 20",
   600              "type": "integer",
   601              "default": 20
   602          }
   603      },
   604      "securityDefinitions": {
   605          "api-key": {
   606              "name": "api-key",
   607              "type": "apiKey",
   608              "in": "query"
   609          }
   610      }
   611  }