Skip to content

Instantly share code, notes, and snippets.

@grEvenX
Created July 31, 2018 11:07
Show Gist options
  • Save grEvenX/089a8c9ecf029560299523ff048cfd5b to your computer and use it in GitHub Desktop.
Save grEvenX/089a8c9ecf029560299523ff048cfd5b to your computer and use it in GitHub Desktop.
Example case for using date-time property in openapi 3.0
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
post:
description: Creates a new pet in the store. Duplicates are allowed
operationId: addPet
requestBody:
description: Pet to add to the store
content:
application/json:
schema:
$ref: '#/components/schemas/NewPet'
components:
schemas:
NewPet:
properties:
born_at:
type: string
format: date-time
animal:
type: string
default: cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment