Skip to content

Instantly share code, notes, and snippets.

View ponelat's full-sized avatar

Josh Ponelat ponelat

View GitHub Profile
@ponelat
ponelat / settings.xml
Last active August 29, 2015 14:23
Error building maven project
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] XXXXXXXXXXX
[INFO] commons
[INFO] XXXXXXXX-api
[INFO] auth-api
[INFO]
[INFO] ------------------------------------------------------------------------
//...
window.swaggerUi = new SwaggerUi({
url: url,
dom_id: "swagger-ui-container",
authorizations: {
someName: new SwaggerClient.PasswordAuthorization("", "<username>", "<password>")
}
// ...........
@ponelat
ponelat / index.html
Created July 14, 2015 16:55
Inlined Spec file.
//...
window.swaggerUi = new SwaggerUi({
url: '',
spec: {
// The json contents of your spec file
}
dom_id: "swagger-ui-container",
// ...........
swagger: '2.0'
info:
title: Uber API 2
description: Move your app forward with the Uber API
version: 1.0.0
host: api.uber.com
schemes:
- https
basePath: /v1
produces:
@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
@ponelat
ponelat / index.html
Created June 11, 2015 13:27
Ron's double Swagger-UI
<!DOCTYPE html>
<html>
<head>
<title>Swagger UI</title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
_,add8ba,
,d888888888b,
d8888888888888b _,ad8ba,_
d888888888888888) ,d888888888b,
I8888888888888888 _________ ,8888888888888b
__________`Y88888888888888P"""""""""""baaa,__ ,888888888888888,
,adP"""""""""""9888888888P""^ ^""Y8888888888888888I
,a8"^ ,d888P"888P^ ^"Y8888888888P'