Skip to content

Instantly share code, notes, and snippets.

@mherwig
Created Dec 20, 2019
Embed
What would you like to do?
Simpliefied Swagger file for pokeapi.co supporting
swagger: "2.0"
info:
description: "The RESTful Pokémon API"
version: "1.0.0"
title: "PokéAPI"
host: "pokeapi.co"
basePath: "/api/v2"
tags:
- name: "pokemon"
description: "Everything about Pokemon"
externalDocs:
description: "Find out more"
url: "https://pokeapi.co/docs/v2.html"
schemes:
- "https"
paths:
/pokemon:
get:
tags:
- "pokemon"
summary: "Find pokemon by ID"
description: "Returns a single pokemon"
operationId: "getPokemon"
produces:
- "application/xml"
- "application/json"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Page"
400:
description: "Invalid ID supplied"
404:
description: "Pokemon not found"
/pokemon/{idOrName}:
get:
tags:
- "pokemon"
summary: "Find pokemon by ID or name"
description: "Returns a single pokemon"
operationId: "getPokemonByIdOrName"
produces:
- "application/xml"
- "application/json"
parameters:
- name: "idOrName"
in: "path"
description: "ID or name of pokemon to return"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Pokemon"
400:
description: "Invalid ID or name supplied"
404:
description: "Pokemon not found"
definitions:
Page:
type: "object"
properties:
count:
type: "integer"
format: "int64"
next:
type: "string"
previous:
type: "string"
results:
type: "array"
items:
type: "object"
properties:
name:
type: "string"
url:
type: "string"
Pokemon:
type: "object"
properties:
id:
type: "integer"
format: "int64"
height:
type: "integer"
format: "int64"
weight:
type: "integer"
format: "int64"
name:
type: "string"
example: "bulbasaur"
sprites:
$ref: "#/definitions/Sprite"
xml:
name: "Pokemon"
Sprite:
type: "object"
properties:
back_default:
type: "string"
back_female:
type: "string"
back_shiny:
type: "string"
back_shiny_female:
type: "string"
front_default:
type: "string"
front_female:
type: "string"
front_shiny:
type: "string"
front_shiny_female:
type: "string"
externalDocs:
description: "Find out more about Swagger"
url: "http://swagger.io"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment