Instantly share code, notes, and snippets.

  1. Retrieve WeatherReport where address is Anchorage, Alaska
  2. Send Payment where the recipient is and currency is USD and amount is 40
  3. Send Message where the recipient is and text is Hey Phil ...
View schemaUtils.js
'use strict';
* This module extends the graphql.js schema and types by adding diff and merge functions.
(function () {
const GraphQLSchema = require('graphql/type/schema').GraphQLSchema,
GraphQLObjectType = require('graphql/type/definition').GraphQLObjectType,
GraphQLScalarType = require('graphql/type/definition').GraphQLScalarType,
GraphQLUnionType = require('graphql/type/definition').GraphQLUnionType,
View client.rb
# Using a terms from dictionary,
# find services that offers WeatherForecast.
services = apiRegistry.find(WeatherForecast, { vocabulary: ""})
# Query a service for WeatherForecast at GeoCoordinates.
forecast = service.retrieve(WeatherForecast, { GeoCoordinates: … })
# Display Temperature
print forecast(Temperature)

Keybase proof

I hereby claim:

  • I am zdne on github.
  • I am zdenek ( on keybase.
  • I have a public key whose fingerprint is AAB0 458B 4299 95C4 5C9F 0CE0 1205 3F7F C8E6 F7A4

To claim this, I am signing this object:

View fizzbuzz.apib
# Fizz Buzz Solving API Blueprint
## Data Structures
## Main (array)
This only does 1 through 15.
### Members
- !map
- (array)
View collection.apib
# User [/users/{id}]
- Attributes (object)
- name: John
- email:
## Retrieve [GET]
- Response 200 (application/json)
- Attributes (User)
## Remove [DELETE]
View version.apib
## Globals Parameters
- version: 1.0 (string) - Version of the API
# Resource A [/{version}/some/path/to/a]
# Resource B [/{version}/some/path/to/b]
View MSON.apib
# Data Document
This document contains a description of a data.
# Data Structures
## Some Data (object)
- name: Z (string) - Good old name.
View gist:5f8295642af18aff27ec

Working with multiple blueprint files

This document describes 4 different solutions to work APIs that consist of multiple blueprint files. Every of this solution work with all features but editing. To edit a blueprint you have to do it outside of Apiary as Apiary editor does not support working with multiple files. In other words if you are using one of the solutions below avoid editing the blueprint in Apiary.

1. Hercule

Hercule is a CLI tool written in Node.js – available as an NPM package. It uses markdown referencing and linking syntax to transclude other files into a blueprint file. This solution is universal and would work with any Markdown files not just API Blueprint.

The major benefit – unlike any other solutions here – is also that the references are rendered as HTML links in any Markdown editor so the result is HTML that can be browsed!