Skip to content

Instantly share code, notes, and snippets.

@psqq
Last active October 19, 2023 14:00
Show Gist options
  • Save psqq/7ed681a95353f7f9838a2522d5875575 to your computer and use it in GitHub Desktop.
Save psqq/7ed681a95353f7f9838a2522d5875575 to your computer and use it in GitHub Desktop.
openapi: 3.0.2
info:
title: API
version: 1.0.0
description: API
tags:
- name: test
description: test
security:
- bearerAuth: [ ]
# Для текущей библиотеки (elements) для просмотра документации это не работает
# - OAuth2: []
paths:
/api/test:
get:
tags:
- test
summary: test
description: test
operationId: test
responses:
'200':
description: Запрос успешно завершен
content:
application/json:
schema:
$ref: '#/components/schemas/A'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
A:
title: A
allOf:
- $ref: '#/components/schemas/B'
- $ref: '#/components/schemas/C'
B:
type: object
title: B
properties:
b:
type: string
C:
title: C
type: object
additionalProperties: false
minProperties: 1
required:
- data
properties:
data:
type: array
items:
$ref: '#/components/schemas/D'
D:
type: object
title: D
properties:
d:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment