A type field identifies which subtype or representation applies to a polymorphic resource instance. Use a validated string rather than an enumeration, so clients can filter and create resources through the same field. section 16.3.2
Message filtering and creation
A Message resource can expose type values such as text, photo, audio, and video. ListMessages() can filter for type = photo, while CreateMessage() accepts the appropriate shape and type value. section 16.3.2
Treat the field as a stable discriminator:
- Validate string values against the supported subtype set. section 16.3.2
- Avoid changing an existing resource from one type to another; relationships may rely on its original shape. section 16.3.2
