openapi: 3.1.0
info:
title: Lorem API Import Example
version: 1.0.0
servers:
- url: https://lorem-api.com/api
components:
schemas:
User:
type: object
required: [id, name, email, avatar]
properties:
id:
type: string
format: uuid
name:
type: string
minLength: 1
maxLength: 120
email:
type: string
format: email
avatar:
type: string
format: uri
Article:
type: object
required: [slug, title, subtitle, image, author, content, dateCreated]
properties:
slug:
type: string
minLength: 1
maxLength: 64
pattern: '^[a-z0-9-]+$'
title:
type: string
minLength: 1
maxLength: 240
subtitle:
type: string
minLength: 1
maxLength: 200
image:
type: string
format: uri
author:
$ref: '#/components/schemas/User'
content:
type: string
minLength: 1
dateCreated:
type: string
format: date-time
paths:
/article/{slug}:
get:
operationId: getArticle
parameters:
- name: slug
in: path
required: true
schema:
type: string
example: foo
responses:
'200':
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/Article'
/user/{id}:
get:
operationId: getUser
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
example: 76a5b162-12c0-4a57-b56e-1a5e882133c0
responses:
'200':
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/User'