Skip to content

Instantly share code, notes, and snippets.

Z zdne

Block or report user

Report or block zdne

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
zdne /
Last active Jun 5, 2019
Explanation of HAL+JSON embedding

Embedding Related Resoruces in HAL

Often, I get questions about embedding resources with HAL Here is some of my recommendation illustrated on an example.

First of all, think of the _embedded as a courtesy of HAL so the API user does not have to make one more call to retrieve a resource that has a link relation with the current (self resource). Let's illustrate it on an example: A collection of applications and one application, where an application might have related, child applications. The link relations are as follow:

collection of applications resource ——application relation——> application resource

application resource ——child relation——> application resource


Keybase proof

I hereby claim:

  • I am zdne on github.
  • I am zdenek ( on keybase.
  • I have a public key ASBe1huF1XGh7mDwe5wbzdbPAShqtgw56p1S0n22kXYAyQo

To claim this, I am signing this object:

  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 ...
zdne / schemaUtils.js
Created Jan 14, 2017 — forked from jarwol/schemaUtils.js
GraphQL diff() and merge() extensions
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]
You can’t perform that action at this time.