Created
June 29, 2017 15:36
-
-
Save databus23/848f60539956284e504605d4d9c01bc1 to your computer and use it in GitHub Desktop.
Example swagger.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
info: | |
title: test | |
version: 1.0.0 | |
consumes: | |
- application/json | |
produces: | |
- application/json | |
swagger: '2.0' | |
securityDefinitions: | |
keystone: | |
description: OpenStack Keystone Authentication | |
type: apiKey | |
in: header | |
name: x-auth-token | |
security: [] | |
paths: | |
/api/v1/clusters/: | |
get: | |
operationId: ListClusters | |
summary: List available clusters | |
responses: | |
200: | |
description: OK | |
schema: | |
type: array | |
items: | |
$ref: '#/definitions/Cluster' | |
security: | |
- keystone: [] | |
post: | |
operationId: CreateCluster | |
summary: Create a cluster | |
responses: | |
200: | |
description: OK | |
schema: | |
$ref: '#/definitions/Cluster' | |
parameters: | |
- name: body | |
in: body | |
required: true | |
schema: | |
$ref: '#/definitions/Cluster' | |
security: | |
- keystone: [] | |
definitions: | |
Cluster: | |
type: object | |
properties: | |
name: | |
description: name of the cluster | |
type: string |
how to use this $ref: '#/definitions/Cluster'
Pretty well explained here:
https://swagger.io/docs/specification/using-ref/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to use this $ref: '#/definitions/Cluster'