Skip to content

Instantly share code, notes, and snippets.

@FFY00
Created August 6, 2019 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FFY00/878f59ec427ef05867cc4f57ba0f17a5 to your computer and use it in GitHub Desktop.
Save FFY00/878f59ec427ef05867cc4f57ba0f17a5 to your computer and use it in GitHub Desktop.
Sample OpenAPI specification that uses anyOf in the request parameters
openapi: 3.0.0
servers:
- url: 'http://localhost:8080'
info:
version: 0.0.1
title: ratbag-emu
license:
name: MIT
url: 'https://raw.githubusercontent.com/libratbag/ratbag-emu/master/LICENSE'
paths:
'/devices/{device_id}/phys_props/dpi/{dpi_id}':
get:
operationId: ratbag_emu.server.get_dpi
parameters:
- name: device_id
in: path
required: true
schema:
type: integer
format: int32
- name: dpi_id
in: path
required: true
schema:
anyOf:
- type: integer
format: int32
- type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: integer
format: int32
'404':
description: Device not found
put:
summary: Changes the value of the specified DPI setting
operationId: ratbag_emu.server.set_dpi
parameters:
- name: device_id
in: path
required: true
schema:
type: integer
format: int32
- name: dpi_id
in: path
required: true
schema:
anyOf:
- type: integer
format: int32
- type: string
responses:
'200':
description: OK
'404':
description: Device not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment