Skip to content

Instantly share code, notes, and snippets.

@zburgermeiszter
Forked from JamesMessinger/NewsArticle.yaml
Created November 21, 2017 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zburgermeiszter/03ed1f87abbf5b64fc5d0d20280ba6b9 to your computer and use it in GitHub Desktop.
Save zburgermeiszter/03ed1f87abbf5b64fc5d0d20280ba6b9 to your computer and use it in GitHub Desktop.
Example of using `allOf` to extend an object in a Swagger API
swagger: "2.0"
info:
version: "1.0.0"
title: minimal
description: News Articles ftw
paths:
/users:
get:
responses:
"200":
description: hello world
definitions:
NewsArticle:
title: NewsArticle
type: object
properties:
id:
type: integer
format: int32
x-mysql-type: int(11)
NewsArticleExt: # tmp
title: NewsArticleExt
type: object
allOf:
- $ref: "#/definitions/NewsArticle"
- properties:
test:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment