Skip to content

Instantly share code, notes, and snippets.

@hacosta
Created April 14, 2016 19:28
Show Gist options
  • Save hacosta/69e9bc635b82eb01dee6398c5720e40d to your computer and use it in GitHub Desktop.
Save hacosta/69e9bc635b82eb01dee6398c5720e40d to your computer and use it in GitHub Desktop.
---
swagger: "2.0"
info:
description: "A simple API"
version: "1.0.0"
title: "A Service"
basePath: "/v1"
schemes:
- "https"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/froble:
post:
summary: "Create a new froble"
parameters:
- in: "body"
name: "frobsppec"
description: "A frobspec object"
required: true
schema:
$ref: "#/definitions/FrobSpec"
responses:
200:
description: "Success"
schema:
$ref: "#/definitions/FrobSpec"
default:
description: "Unexpected error"
schema:
$ref: "#/definitions/Error"
x-tags:
- tag: "Build"
/widget/{id}:
get:
parameters:
- name: "id"
in: "path"
description: "Build ID"
required: true
type: "integer"
responses:
200:
description: "Specification"
schema:
type: "string"
default:
description: "Unexpected error"
schema:
$ref: "#/definitions/Error"
/platforms:
get:
tags:
- "Platforms"
summary: "Supported Platforms"
parameters:
responses:
200:
description: "Supported platforms"
schema:
$ref: "#/definitions/Platform"
default:
description: "Unexpected error"
schema:
$ref: "#/definitions/Error"
definitions:
Platform:
type: "object"
required:
- name
properties:
name:
type: "string"
x:
type: "string"
y:
type: "string"
Repo:
type: "object"
required:
- name
properties:
name:
type: string
description: "Name of the component"
foo:
type: "string"
bar:
type: "string"
FrobSpec:
type: "object"
properties:
version:
type: "number"
description: "Buildspec Version"
repos:
type: object
additionalProperties:
$ref: "#/definitions/Repo"
platforms:
type: object
additionalProperties:
$ref: "#/definitions/Platform"
target:
type: "string"
opts:
type: "object"
description: "tbd"
properties: {}
Error:
type: "object"
properties:
code:
type: "integer"
format: "int32"
message:
type: "string"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment