본문으로 건너뛰기

OpenAPI

V3

openapi: 3.1.0 # Required
info: # Required
title: Sample API # Required
version: 0.1.0 # Required
description: Sample
servers:
- url: https://dev.loliot.net # Required
description: Development server
paths:
/<path>:
<get|put|post|delete|options|head|patch|trace>:
tags:
- <tag>
operationId: <operationId> # 모든 작업에 대해 고유해야 하며 대소문자를 구분합니다.
summary: <summary>
parameters:
- $ref: "#/components/parameters/<parameter>"
requestBody:
$ref: "#/components/requestBodies/<requestBody>"
responses:
"<statusCode>":
$ref: "#/components/responses/<response>"
default:
$ref: "#/components/responses/<response>"
components:
schemas:
<schema>: {}
parameters:
<parameter>: {}
requestBodies:
<requestBody>:
content:
application/json:
schema: {}
responses:
<response>:
content:
application/json:
schema: {}
examples:
<example>:
value: {}

Data Type

string

type: string
# format: <format>
# pattern: '<regex>'
# minLength: 1
# maxLength: 10
# nullable: true
# enum: [a, b, c] # "null"과 null을 구분합니다.
  • <format>
    • date
    • date-time
    • password
    • byte
    • binary
    • 기타 사용자 정의

array

type: array
items: {} # any type
# minItems: 1
# maxItems: 10
# uniqueItems: true