Skip to content

Instantly share code, notes, and snippets.

@JamesMessinger
Created April 15, 2016 15:25
Show Gist options
  • Save JamesMessinger/5ad1a760acbb598d38c5dbba223eb9bd to your computer and use it in GitHub Desktop.
Save JamesMessinger/5ad1a760acbb598d38c5dbba223eb9bd to your computer and use it in GitHub Desktop.
This example demonstrates a simple URL-encoded JSON Pointer in a Swagger 2.0 API definition
swagger: "2.0"
info:
version: 1.0.0
title: Example
paths:
"/foo":
get:
responses:
200:
description: Success
schema:
# This line works in Swagger Editor,
# but the "{" and "}" characters are technically invalid,
# according to RFC 6901, sections 5 & 6 - https://tools.ietf.org/html/rfc6901#section-5
# $ref: "#/definitions/foo bar"
# This line is valid, according to RFC 6901
# (the space character has been encoded)
# But, it doesn't work in Swagger Editor
$ref: "#/definitions/foo%20bar"
definitions:
foo bar:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment