{
  "info": {
    "name": "Anthony as an API",
    "description": "Anthony Viard, Senior Developer Advocate at Postman, as a read-only JSON API. Static files, no key, no rate limit, CORS open.\n\nSite: https://avdev4j.dev · OpenAPI: https://avdev4j.dev/api/openapi.json\n\nRun the collection to check every endpoint answers with the expected shape.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.0.0"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://avdev4j.dev/api",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Index",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/",
          "host": [
            "{{baseUrl}}"
          ],
          "path": []
        },
        "description": "List the endpoints."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Lists the endpoints', () => pm.expect(pm.response.json().endpoints).to.include.keys([\"profile\",\"now\",\"articles\",\"projects\",\"videos\",\"speaker\",\"cv\",\"social\",\"contact\"]));"
            ]
          }
        }
      ]
    },
    {
      "name": "Profile",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/profile",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "profile"
          ]
        },
        "description": "Who Anthony is: name, headline, bio, current role, location and links."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"name\",\"handle\",\"headline\",\"bio\",\"current_role\",\"location\",\"languages\",\"website\",\"photo\",\"links\"]));",
              "pm.test('Works at Postman', () => pm.expect(pm.response.json().current_role.company).to.eql('Postman'));"
            ]
          }
        }
      ]
    },
    {
      "name": "Now",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/now",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "now"
          ]
        },
        "description": "What Anthony is working on this month, with the date of the last update."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"updated\",\"lines\",\"page\"]));",
              "pm.test('Has an update date', () => pm.expect(pm.response.json().updated).to.match(/^\\d{4}-\\d{2}-\\d{2}$/));"
            ]
          }
        }
      ]
    },
    {
      "name": "Articles",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/articles",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "articles"
          ]
        },
        "description": "Articles from dev.to and elsewhere, newest first, with their tags and a tag count (snapshot taken at build time)."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"source\",\"count\",\"tags\",\"items\",\"series\",\"all\"]));",
              "pm.test('count matches items', () => { const j = pm.response.json(); pm.expect(j.items.length).to.eql(j.count); });",
              "pm.test('Every article has tags', () => pm.response.json().items.forEach((a) => pm.expect(a.tags).to.be.an('array')));"
            ]
          }
        }
      ]
    },
    {
      "name": "Projects",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/projects",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "projects"
          ]
        },
        "description": "Open source projects, with their GitHub repository, description and stars (snapshot taken at build time)."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"count\",\"github_snapshot\",\"items\"]));",
              "pm.test('count matches items', () => { const j = pm.response.json(); pm.expect(j.items.length).to.eql(j.count); });",
              "pm.test('GitHub stars are numbers', () => pm.response.json().items.filter((p) => p.github).forEach((p) => pm.expect(p.github.stars).to.be.a('number')));"
            ]
          }
        }
      ]
    },
    {
      "name": "Videos",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/videos",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "videos"
          ]
        },
        "description": "YouTube channel and talks."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"channel\",\"count\",\"items\"]));",
              "pm.test('count matches items', () => { const j = pm.response.json(); pm.expect(j.items.length).to.eql(j.count); });"
            ]
          }
        }
      ]
    },
    {
      "name": "Speaker kit",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/speaker",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "speaker"
          ]
        },
        "description": "For event organizers: short and long bio, HD photos, talk topics, formats, languages and technical rider."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"bio\",\"photos\",\"topics\",\"formats\",\"languages\",\"technical_rider\",\"invite\",\"page\"]));"
            ]
          }
        }
      ]
    },
    {
      "name": "Resume",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/cv",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "cv"
          ]
        },
        "description": "Professional experience, community roles, education, languages, certifications and skills."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"experience\",\"community\",\"education\",\"languages\",\"certifications\",\"skills\",\"pdf\",\"linkedin\"]));"
            ]
          }
        }
      ]
    },
    {
      "name": "Social",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/social",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "social"
          ]
        },
        "description": "Where to follow Anthony."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"count\",\"items\"]));",
              "pm.test('count matches items', () => { const j = pm.response.json(); pm.expect(j.items.length).to.eql(j.count); });"
            ]
          }
        }
      ]
    },
    {
      "name": "Contact",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/contact",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "contact"
          ]
        },
        "description": "How to reach Anthony. No e-mail on purpose."
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('Status is 200', () => pm.response.to.have.status(200));",
              "pm.test('Response is JSON', () => pm.response.to.be.json);",
              "pm.test('Has the expected fields', () => pm.expect(pm.response.json()).to.include.keys([\"preferred\",\"message\",\"hire_me\"]));"
            ]
          }
        }
      ]
    }
  ]
}
