Skip to content

Instantly share code, notes, and snippets.

@rajiff
Last active December 19, 2017 06:04
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 rajiff/9f384972505a01be758f44a2583b4dd5 to your computer and use it in GitHub Desktop.
Save rajiff/9f384972505a01be758f44a2583b4dd5 to your computer and use it in GitHub Desktop.
swagger: "2.0"
info:
version: "1.0.0"
title: SwaggerNodeJSDemo
# during dev, should point to your local machine
host: localhost:3000
# basePath prefixes all resource paths
basePath: /api/v1
schemes:
# tip: remove http to make production-grade
- http
# - https
# format of bodies a client can send (Content-Type)
consumes:
- application/json
# format of the responses to the client (Accepts)
produces:
- application/json
paths:
/:
get:
description: root path
responses:
"404":
description: Success
schema:
$ref: "#/definitions/ErrorResponse"
# complex objects have schema definitions
definitions:
ErrorResponse:
required:
- message
properties:
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment