Use the Type field to determine which variant is active, then access the corresponding field:
switch capabilityDescriptor.Type { case components.CapabilityDescriptorTypeEnum: // capabilityDescriptor.EnumCapability is populated case components.CapabilityDescriptorTypeRange: // capabilityDescriptor.RangeCapability is populated case components.CapabilityDescriptorTypeBoolean: // capabilityDescriptor.BooleanCapability is populated default: // Unknown type - use capabilityDescriptor.GetUnknownRaw() for raw JSON}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.