swagger-routes
Version:
Generate Express or Restify route handlers from a Swagger specification
59 lines (58 loc) • 1.17 kB
YAML
swagger: "2.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
host: petstore.swagger.io
basePath: /v1
schemes:
- http
consumes:
- application/json
produces:
- application/json
securityDefinitions:
petstore_auth:
type: oauth2
authorizationUrl: http://swagger.io/api/oauth/dialog
flow: implicit
scopes:
'write:pets': modify pets in your account
'read:pets': read your pets
petstore_auth2:
type: oauth2
authorizationUrl: http://swagger.io/api/oauth/dialog
flow: implicit
scopes:
'scopeA': token scope A
'scopeB': token scope B
paths:
/pets:
post:
summary: Create a pet
operationId: createPets
tags:
- pets
responses:
201:
description: Null response
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
security:
- petstore_auth:
- write:pets
- read:pets
definitions:
Error:
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string