Skip to content

Instantly share code, notes, and snippets.

@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:31
Example API with RAML Step 9
# document root
types:
Error: !include types/error.raml
Gender: !include types/gender.raml
UserBase: !include types/userBase.raml
User: !include types/user.raml
Users: User[]
traits:
@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:30
Example API with RAML Step 8
#%RAML 1.0
title: Example API
protocols: HTTPS
version: v1
baseUri: https://example.com/api/{version}
mediaType: application/json
securitySchemes:
oauth1:
type: OAuth 1.0
settings:
@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:28
Example API with RAML Step 7
# document root and types
traits:
BadRequest:
responses:
400:
description: Required properties missing or validation issues.
body:
type: Error
@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:26
Example API with RAML Step 6
# document root and types
/users:
# get operation
post:
description: Create new user.
body:
type: UserBase
responses:
201:
@sebastianhenneberg
sebastianhenneberg / api.raml
Last active January 23, 2016 18:59
Example API with RAML Step 5
# document root
types:
Error:
properties:
code: integer
message: string
Gender:
type: string
enum: [ male, female ]
@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:16
Example API with RAML Step 4
# document root
types:
Gender:
type: string
enum: [ male, female ]
User:
properties:
id: integer
name: string
@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:15
Example API with RAML Step 3
#%RAML 1.0
title: Example API
protocols: HTTPS
version: v1
baseUri: https://example.com/api/{version}
mediaType: application/json
types:
Gender:
type: string
@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:13
Example API with RAML Step 2
#%RAML 1.0
title: Example API
protocols: HTTPS
version: v1
baseUri: https://example.com/api/{version}
mediaType: application/json
/users:
get:
description: Get all users.
@sebastianhenneberg
sebastianhenneberg / api.raml
Created January 22, 2016 16:13
Example API with RAML Step 1
#%RAML 1.0
title: Example API
protocols: HTTPS
version: v1
baseUri: https://example.com/api/{version}
mediaType: application/json
@sebastianhenneberg
sebastianhenneberg / dropdownServicePatch.js
Created June 8, 2015 15:48
Monkey patch for dropdownService of angular-ui/bootstrap to support nested dropdowns
(function() {
'use strict';
/**
* This monkey-patch for the dropdownService enables to nest dropdowns.
* Issue: https://github.com/angular-ui/bootstrap/issues/2421
* PR: https://github.com/angular-ui/bootstrap/pull/3776
*/