Skip to content

Instantly share code, notes, and snippets.

@pavelbucek
Last active August 7, 2017 07:33
Show Gist options
  • Save pavelbucek/7b5219f5ccd662a8a369c40ec3c8b3b7 to your computer and use it in GitHub Desktop.
Save pavelbucek/7b5219f5ccd662a8a369c40ec3c8b3b7 to your computer and use it in GitHub Desktop.
swagger: "2.0"
info:
version: "1.0.0"
title: "catalog-swagger"
host: "localhost"
basePath: "/v1"
schemes:
- "http"
produces:
- "application/json"
paths:
/categories:
get:
operationId: "getCategories"
tags:
- "categories"
responses:
200:
schema:
type: "array"
items:
type: "number"
format: "int32"
description: ""
examples:
application/json: |-
[1, 2, 3]
/categories/{id}:
get:
description: "Get category detail by id."
operationId: "getCategory"
tags:
- "categories"
parameters:
- name: "id"
in: "path"
required: true
type: "number"
format: "int32"
default: 1
responses:
200:
description: ""
schema:
$ref: "#/definitions/Category"
definitions:
Category:
required:
- "id"
- "name"
properties:
id:
type: "number"
format: "int32"
example: 1
name:
type: "string"
example: "Software"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment