Skip to content

Instantly share code, notes, and snippets.

@gunzip
Created September 5, 2025 15:22
Show Gist options
  • Save gunzip/56081a5eb0031be3d1fa383617d9fd6d to your computer and use it in GitHub Desktop.
Save gunzip/56081a5eb0031be3d1fa383617d9fd6d to your computer and use it in GitHub Desktop.
openapi: 3.1.0
info:
title: Test API
description: Test API.
version: 1.0.0
servers:
- url: https://localhost/api/v1
- url: https://localhost/api/v2
paths:
/test-multiple-success:
post:
operationId: "testMultipleSuccess"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/NewModel"
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/AnotherModel"
responses:
"201":
application/json:
schema:
$ref: "#/components/schemas/AnotherModel"
application/xml:
schema:
$ref: "#/components/schemas/NewModelXml"
"200":
description: "Will return a Message"
content:
application/json:
schema:
$ref: "#/components/schemas/NewModel"
application/xml:
schema:
$ref: "#/components/schemas/NewModelXml"
"403":
description: "You do not have necessary permissions for the resource"
content:
application/json:
schema:
$ref: "#/components/schemas/Blob"
"404":
description: "Not found"
default:
description: "You do not have necessary permissions for the resource"
content:
application/json:
schema:
$ref: "#/components/schemas/Blob"
components:
schemas:
NewModel:
type: object
properties:
id:
type: string
minLength: 1
name:
type: string
required:
- id
NewModelXml:
type: object
properties:
id-xml:
type: string
minLength: 10
name-xml:
type: string
required:
- id-xml
AnotherModel:
type: object
properties:
id-another:
type: string
name-another:
type: string
required:
- id-another
Blob:
type: object
properties:
id:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment