Skip to content

Commit c0f6b77

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 04e02c3 commit c0f6b77

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
@@ -5812,24 +5812,36 @@ components:
58125812
- type
58135813
- mediaHitTime
58145814
Action:
5815-
type: object
58165815
description: An action that is performed when a trigger is activated.
58175816
oneOf:
5818-
- type: object
5819-
properties:
5820-
type:
5821-
type: string
5822-
enum:
5823-
- BACK
5824-
- CLOSE
5825-
required:
5826-
- type
5817+
- $ref: "#/components/schemas/ReturnAction"
58275818
- $ref: "#/components/schemas/OpenURLAction"
58285819
- $ref: "#/components/schemas/UpdateMediaRuntimeAction"
58295820
- $ref: "#/components/schemas/SetVariableAction"
58305821
- $ref: "#/components/schemas/SetVariableModeAction"
58315822
- $ref: "#/components/schemas/ConditionalAction"
58325823
- $ref: "#/components/schemas/NodeAction"
5824+
discriminator:
5825+
propertyName: type
5826+
mapping:
5827+
BACK: "#/components/schemas/ReturnAction"
5828+
CLOSE: "#/components/schemas/ReturnAction"
5829+
URL: "#/components/schemas/OpenURLAction"
5830+
UPDATE_MEDIA_RUNTIME: "#/components/schemas/UpdateMediaRuntimeAction"
5831+
SET_VARIABLE: "#/components/schemas/SetVariableAction"
5832+
SET_VARIABLE_MODE: "#/components/schemas/SetVariableModeAction"
5833+
CONDITIONAL: "#/components/schemas/ConditionalAction"
5834+
NODE: "#/components/schemas/NodeAction"
5835+
ReturnAction:
5836+
type: object
5837+
properties:
5838+
type:
5839+
type: string
5840+
enum:
5841+
- BACK
5842+
- CLOSE
5843+
required:
5844+
- type
58335845
OpenURLAction:
58345846
type: object
58355847
description: An action that opens a URL.

0 commit comments

Comments
 (0)