Revision control
# Copyright (C) 2026 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
openapi: 3.1.0
servers:
- url: 'http://127.0.0.1:19085/v2'
info:
title: Some Test
description: >
This specification is intended for testing purposes.
version: 1.0.0
tags:
- name: store
description: store test file
- name: farm
description: a farm shop
+ - name: bank
+ description: bank data
paths:
/pets:
patch:
tags:
- store
operationId: patchPetData
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
required: true
responses:
"200":
description: Updated
post:
tags:
- store
operationId: postPetData
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
responses:
"200":
description: Updated
/farm-pets:
post:
tags:
- farm
operationId: postFarmPet
requestBody:
content:
application/json:
schema:
# here we use oneOf directly in requestBody
# generates 'PostFarmPet_request' model
oneOf:
- $ref: "#/components/schemas/Bunny"
- $ref: "#/components/schemas/Duck"
- $ref: "#/components/schemas/Dog"
required: true
responses:
"200":
description: Updated
+ /pay-for-pet:
+ post:
+ tags:
+ - bank
+ operationId: postPaymentData
+ requestBody:
+ content:
+ application/json:
+ schema:
+ # inline objects
+ # generates 'PostPaymentData_request' model
+ oneOf:
+ - type: object
+ required: [cardNumber]
+ properties:
+ cardNumber:
+ type: string
+ cardAvailability:
+ type: boolean
+ - type: object
+ properties:
+ paypalEmail:
+ type: string
+ paypalAvailability:
+ type: boolean
+ required: true
+ responses:
+ "200":
+ description: Updated
+ patch:
+ tags:
+ - bank
+ operationId: patchPaymentData
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ # here we use oneOf directly in requestBody, but with primitive types
+ # generates 'PatchPaymentData_request' model
+ oneOf:
+ - type: string
+ - type: boolean
+ - type: number
+ format: double
+ responses:
+ "200":
+ description: Updated
components:
schemas:
Pet:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
Dog:
type: object
required:
- bark
properties:
bark:
type: boolean
breed:
type: string
enum: [Dingo, Husky, Retriever, Shepherd]
Cat:
type: object
properties:
hunts:
type: boolean
age:
type: integer
Bunny:
type: object
properties:
weight:
type: integer
breed-type:
type: string
enum: [FlemishGiant, FrenchLop, Himalayan, Havana]
Duck:
type: object
properties:
hunts:
type: boolean
age:
type: integer