Skip to content

Instantly share code, notes, and snippets.

View ponelat's full-sized avatar

Josh Ponelat ponelat

View GitHub Profile
@ponelat
ponelat / swagger.yaml
Created January 25, 2016 13:52
some yaml spec
swagger: '2.0'
info:
version: '9.9.9'
title: Just some spec
@ponelat
ponelat / .js
Last active February 11, 2016 12:54
function addAuth(obj) {
// Here we add an authorization, we need to add a securityType to each operation that should get this auth.
// See: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#security-definitions-object
// And see petstore for an example, where they have a security names 'api_key'
window.swaggerUi.api.clientAuthorizations.add("my_auth_name", window.SwaggerClient.ApiKeyAuthorization('header name', value, 'header')
}
window.swaggerUi = new SwaggerUi({
url: 'swagger.json',
responseInterceptor: function() {
@ponelat
ponelat / apisjson_v0.15.txt
Created February 22, 2016 12:22
ApisJson v0.15
Draft for Comment
Name: API Discovery Format
Informal Name: APIs.json
Authors: Kin Lane, Steven Willmott, Nicolas Grenie, Bruno Pedro
Date: 29/04/2015
Location: http://apicommons.org/apisjson/apisjson_v0.15.txt
A Simple Format for Publishing API Meta Data on the Web
Table of Contents
_,add8ba,
,d888888888b,
d8888888888888b _,ad8ba,_
d888888888888888) ,d888888888b,
I8888888888888888 _________ ,8888888888888b
__________`Y88888888888888P"""""""""""baaa,__ ,888888888888888,
,adP"""""""""""9888888888P""^ ^""Y8888888888888888I
,a8"^ ,d888P"888P^ ^"Y8888888888P'
@ponelat
ponelat / gist:08187dc9ef69468728d4c5a73bb471c6
Last active July 15, 2016 07:50
Clean docker ( oneline )
sudo docker rm -v $(sudo docker ps -a -q -f status=exited); sudo docker rmi $(sudo docker images -f "dangling=true" -q); sudo docker volume rm $(sudo docker volume ls -qf dangling=true)
{"swagger":"2.0","info":{"description":"This is an online swagger codegen server. You can find out more at https://github.com/swagger-api/swagger-codegen or on [irc.freenode.net, #swagger](http://swagger.io/irc/).","version":"2.2.0-SNAPSHOT","title":"Swagger Generator","termsOfService":"http://swagger.io/terms/","contact":{"name":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"basePath":"/api","tags":[{"name":"gen"},{"name":"clients"},{"name":"servers"}],"paths":{"/gen/clients":{"get":{"tags":["clients"],"summary":"Gets languages supported by the client generator","description":"","operationId":"clientOptions","parameters":[],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"}}}}}},"/gen/clients/{language}":{"get":{"tags":["clients"],"summary":"Returns options for a client library","description":"","operationId":"getClientOptions","produces":["application/json"],"parameters":[{"name":"langu
{"swagger":"2.0","info":{"description":"This is an online swagger codegen server. You can find out more at https://github.com/swagger-api/swagger-codegen or on [irc.freenode.net, #swagger](http://swagger.io/irc/).","version":"2.2.0-SNAPSHOT","title":"Swagger Generator","termsOfService":"http://swagger.io/terms/","contact":{"name":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"basePath":"/api","tags":[{"name":"gen"},{"name":"clients"},{"name":"servers"}],"paths":{"/gen/clients":{"get":{"tags":["clients"],"summary":"Gets languages supported by the client generator","description":"","operationId":"clientOptions","parameters":[],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"}}}}}},"/gen/clients/{language}":{"get":{"tags":["clients"],"summary":"Returns options for a client library","description":"","operationId":"getClientOptions","produces":["application/json"],"parameters":[{"name":"langu
@ponelat
ponelat / docker-clean.sh
Last active August 5, 2016 15:53
docker clean
#!/bin/sh
# Run with...
# Use the raw github link ( there will be a button on this page)
# curl -sL https://gist.githubusercontent.com/.... | sudo bash
echo ====================================================
docker rm -v $(docker ps -a -q -f status=exited) || echo 'No containers to clean up with status=exited'
echo ====================================================
docker rmi $(docker images -f "dangling=true" -q) || echo 'No images to clean up with dangling=true'
{
"swagger": "2.0",
"info": {
"title": "Valid JSON"
}
}