From c0f6b77b84791dddef16ae01a2831aecc33b2895 Mon Sep 17 00:00:00 2001 From: Don Olmstead Date: Wed, 1 Oct 2025 11:07:04 -0700 Subject: [PATCH] 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. --- openapi/openapi.yaml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 8e49ea6..4609dc5 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -5812,24 +5812,36 @@ components: - type - mediaHitTime Action: - type: object description: An action that is performed when a trigger is activated. oneOf: - - type: object - properties: - type: - type: string - enum: - - BACK - - CLOSE - required: - - type + - $ref: "#/components/schemas/ReturnAction" - $ref: "#/components/schemas/OpenURLAction" - $ref: "#/components/schemas/UpdateMediaRuntimeAction" - $ref: "#/components/schemas/SetVariableAction" - $ref: "#/components/schemas/SetVariableModeAction" - $ref: "#/components/schemas/ConditionalAction" - $ref: "#/components/schemas/NodeAction" + discriminator: + propertyName: type + mapping: + BACK: "#/components/schemas/ReturnAction" + CLOSE: "#/components/schemas/ReturnAction" + URL: "#/components/schemas/OpenURLAction" + UPDATE_MEDIA_RUNTIME: "#/components/schemas/UpdateMediaRuntimeAction" + SET_VARIABLE: "#/components/schemas/SetVariableAction" + SET_VARIABLE_MODE: "#/components/schemas/SetVariableModeAction" + CONDITIONAL: "#/components/schemas/ConditionalAction" + NODE: "#/components/schemas/NodeAction" + ReturnAction: + type: object + properties: + type: + type: string + enum: + - BACK + - CLOSE + required: + - type OpenURLAction: type: object description: An action that opens a URL.