Skip to content

Add canonical OP#6 test for anonymous instance validation (UUID id + type field) #64

@GeraBart

Description

@GeraBart

Context

The GTS spec (section 3.7) defines anonymous instances as objects with an opaque UUID id and a separate type field carrying the GTS schema reference:

{
  "id": "7a1d2f34-5678-49ab-9012-abcdef123456",
  "type": "gts.x.core.events.type.v1~x.commerce.orders.order_placed.v1.0~",
  ...
}

The ./examples/events folder includes anonymous event instances following this pattern. Section 9.9 states: "Support UUIDs (format: uuid) for instance id fields."

However, all existing OP#6 (Schema Validation) tests use well-known chained GTS instance IDs for both registration and validation. There is no canonical test that:

  1. Registers an anonymous instance with a UUID id + type field
  2. Validates it via /validate-instance using the UUID as the instance identifier

Problem

Without a canonical test, implementations may not support the anonymous instance validation path described in the spec. For example, gts-ts currently rejects UUID-based instance IDs in validateInstance() because parseGtsID() requires the gts. prefix and proper segment format.

Proposed Test

Add an OP#6 test case that:

  1. Registers a schema (e.g., the existing gts.x.test6.events.type.v1~)
  2. Registers an anonymous instance with id: "<uuid>" and type: "<schema-id>"
  3. Calls /validate-instance with the UUID as instance_id
  4. Asserts validation succeeds (or defines how anonymous instances should be validated)

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions