Skip to content

Commit f2943bf

Browse files
committed
add discriminator for Action
The type of `Action` is stated in the `type` property. Provide a mapping to the types based on `type`'s value. Create a `ReturnAction` type rather than an anonymous type to map to.
1 parent 887d806 commit f2943bf

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

openapi/openapi.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5827,24 +5827,36 @@ components:
58275827
- type
58285828
- mediaHitTime
58295829
Action:
5830-
type: object
58315830
description: An action that is performed when a trigger is activated.
58325831
oneOf:
5833-
- type: object
5834-
properties:
5835-
type:
5836-
type: string
5837-
enum:
5838-
- BACK
5839-
- CLOSE
5840-
required:
5841-
- type
5832+
- $ref: "#/components/schemas/ReturnAction"
58425833
- $ref: "#/components/schemas/OpenURLAction"
58435834
- $ref: "#/components/schemas/UpdateMediaRuntimeAction"
58445835
- $ref: "#/components/schemas/SetVariableAction"
58455836
- $ref: "#/components/schemas/SetVariableModeAction"
58465837
- $ref: "#/components/schemas/ConditionalAction"
58475838
- $ref: "#/components/schemas/NodeAction"
5839+
discriminator:
5840+
propertyName: type
5841+
mapping:
5842+
BACK: "#/components/schemas/ReturnAction"
5843+
CLOSE: "#/components/schemas/ReturnAction"
5844+
URL: "#/components/schemas/OpenURLAction"
5845+
UPDATE_MEDIA_RUNTIME: "#/components/schemas/UpdateMediaRuntimeAction"
5846+
SET_VARIABLE: "#/components/schemas/SetVariableAction"
5847+
SET_VARIABLE_MODE: "#/components/schemas/SetVariableModeAction"
5848+
CONDITIONAL: "#/components/schemas/ConditionalAction"
5849+
NODE: "#/components/schemas/NodeAction"
5850+
ReturnAction:
5851+
type: object
5852+
properties:
5853+
type:
5854+
type: string
5855+
enum:
5856+
- BACK
5857+
- CLOSE
5858+
required:
5859+
- type
58485860
OpenURLAction:
58495861
type: object
58505862
description: An action that opens a URL.

0 commit comments

Comments
 (0)