---
paths:
/widgets:
post:
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/WidgetPost"
required: true
responses:
201:
content:
application/json:
schema:
$ref: "#/components/schemas/Widget"
components:
schemas:
Widget:
type: object
description: |
A displayable widget.
required:
- id
- name
- readonly
properties:
comment:
type: string
id:
type: string
example: e35a3c8d-5486-49ec-9b23-6747afc19570
format: uuid
name:
type: string
readonly:
type: string
additionalProperties: false
WidgetMergePatch:
type: object
description: |
(Parameters used to PATCH the `Widget` type.)
A displayable widget.
properties:
comment:
oneOf:
- type: string
title: "Overwrite"
description: "Pass this value to overwrite the existing value."
- type: "null"
title: "Clear"
description: "Pass `null` to clear this field's existing value."
name:
type: string
additionalProperties: false
WidgetPost:
type: object
description: |
(Parameters used to POST a new value of the `Widget` type.)
A displayable widget.
required:
- name
- readonly
properties:
comment:
type: string
name:
type: string
readonly:
type: string
additionalProperties: false
WidgetPut:
description: |
(Parameters used to PUT a value of the `Widget` type.)
A displayable widget.
type: object
required:
- name
properties:
comment:
type: string
name:
type: string
additionalProperties: false
info:
title: Example OpenAPI definition
openapi: 3.1.0