Skip to content
Permalink
master
Switch branches/tags
Go to file
1 contributor

Users who have contributed to this file

openapi: "3.0.0"
info:
version: 1.0.0
title: Persons API example
license:
name: MIT
servers:
- url: http://example.com/api
paths:
/persons:
get:
summary: List all persons
operationId: listPersons
tags:
- persons
responses:
200:
description: An paged array of persons
content:
application/json:
schema:
$ref: "#/components/schemas/Persons"
/persons/{personId}:
get:
summary: Info for a specific person
operationId: showPersonById
tags:
- persons
parameters:
- name: personId
in: path
required: true
description: The id of the person to retrieve
schema:
type: string
responses:
200:
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
components:
schemas:
Person:
required:
- id
- email
- name
- salary
- birthDate
properties:
id:
type: string
format: uuid
email:
type: string
format: email
name:
type: string
maxLength: 20
salary:
type: number
format: float
minimum: 100
maximum: 1000000
birthDate:
type: string
format: date
tags:
type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
type: string
enum:
- manager
- admin
- programmer
Persons:
type: array
items:
$ref: "#/components/schemas/Person"