Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
323 changes: 215 additions & 108 deletions README.md

Large diffs are not rendered by default.

348 changes: 348 additions & 0 deletions adr/0002-strict-allof-derivation-form.md

Large diffs are not rendered by default.

18 changes: 1 addition & 17 deletions examples/events/types/gts.x.core.events.type.v1~.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,7 @@
"tenantId",
"occurredAt"
],
"x-gts-traits-schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"topicRef": {
"description": "GTS ID of the topic/stream where events of this type are published.",
"type": "string",
"x-gts-ref": "gts.x.core.events.topic.v1~",
"default": "gts.x.core.events.topic.v1~x.core._.default.v1"
},
"retention": {
"description": "ISO 8601 duration for event retention.",
"type": "string",
"default": "P30D"
}
}
},
"x-gts-traits-schema": "gts://gts.x.core.traits.event_meta.v1~",
"properties": {
"type": {
"description": "Identifier of the event type in GTS format.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,31 @@
"title": "Event Instance Schema: order.placed",
"type": "object",
"allOf": [
{ "$ref": "gts://gts.x.core.events.type.v1~" },
{
{ "$ref": "gts://gts.x.core.events.type.v1~" }
],
"required": ["type", "payload", "subjectType"],
"x-gts-traits": {
"topicRef": "gts.x.core.events.topic.v1~x.commerce._.orders.v1",
"retention": "P90D"
},
"properties": {
"type": {
"const": "gts.x.core.events.type.v1~x.commerce.orders.order_placed.v1.0~",
"$comment": "The value is required only for IDE-side validation"
},
"payload": {
"type": "object",
"required": ["type", "payload", "subjectType"],
"x-gts-traits": {
"topicRef": "gts.x.core.events.topic.v1~x.commerce._.orders.v1",
"retention": "P90D"
},
"required": ["orderId", "customerId", "totalAmount", "items"],
"properties": {
"type": {
"const": "gts.x.core.events.type.v1~x.commerce.orders.order_placed.v1.0~",
"$comment": "The value is required only for IDE-side validation"
},
"payload": {
"type": "object",
"required": ["orderId", "customerId", "totalAmount", "items"],
"properties": {
"orderId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string", "format": "uuid" },
"totalAmount": { "type": "number" },
"items": { "type": "array", "items": { "type": "object" } }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.commerce.orders.order.v1.0~"
}
"orderId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string", "format": "uuid" },
"totalAmount": { "type": "number" },
"items": { "type": "array", "items": { "type": "object" } }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.commerce.orders.order.v1.0~"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,32 @@
"title": "Event Instance Schema: order.placed",
"type": "object",
"allOf": [
{ "$ref": "gts://gts.x.core.events.type.v1~" },
{
{ "$ref": "gts://gts.x.core.events.type.v1~" }
],
"required": ["type", "payload", "subjectType"],
"x-gts-traits": {
"topicRef": "gts.x.core.events.topic.v1~x.commerce._.orders.v1",
"retention": "P90D"
},
"properties": {
"type": {
"const": "gts.x.core.events.type.v1~x.commerce.orders.order_placed.v1.1~",
"$comment": "The value is required only for IDE-side validation"
},
"payload": {
"type": "object",
"required": ["type", "payload", "subjectType"],
"x-gts-traits": {
"topicRef": "gts.x.core.events.topic.v1~x.commerce._.orders.v1",
"retention": "P90D"
},
"required": ["orderId", "customerId", "totalAmount", "items"],
"properties": {
"type": {
"const": "gts.x.core.events.type.v1~x.commerce.orders.order_placed.v1.1~",
"$comment": "The value is required only for IDE-side validation"
},
"payload": {
"type": "object",
"required": ["orderId", "customerId", "totalAmount", "items"],
"properties": {
"orderId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string", "format": "uuid" },
"totalAmount": { "type": "number" },
"items": { "type": "array", "items": { "type": "object" } },
"new_field_in_v1_1": { "type": "string", "default": "some_value" }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.commerce.orders.order.v1.0~"
}
"orderId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string", "format": "uuid" },
"totalAmount": { "type": "number" },
"items": { "type": "array", "items": { "type": "object" } },
"new_field_in_v1_1": { "type": "string", "default": "some_value" }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.commerce.orders.order.v1.0~"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,32 @@
"description": "Event instance schema for the user.created event type",
"type": "object",
"allOf": [
{ "$ref": "gts://gts.x.core.events.type.v1~" },
{
{ "$ref": "gts://gts.x.core.events.type.v1~" }
],
"required": ["type", "payload", "subjectType"],
"x-gts-traits": {
"topicRef": "gts.x.core.events.topic.v1~x.core.idp.contacts.v1",
"retention": "P365D"
},
"properties": {
"type": {
"const": "gts.x.core.events.type.v1~x.core.idp.contact_created.v1.0~",
"$comment": "The value is required only for IDE-side validation"
},
"payload": {
"type": "object",
"required": ["type", "payload", "subjectType"],
"x-gts-traits": {
"topicRef": "gts.x.core.events.topic.v1~x.core.idp.contacts.v1",
"retention": "P365D"
},
"required": ["userId", "email", "name", "roles"],
"additionalProperties": false,
"properties": {
"type": {
"const": "gts.x.core.events.type.v1~x.core.idp.contact_created.v1.0~",
"$comment": "The value is required only for IDE-side validation"
},
"payload": {
"type": "object",
"required": ["userId", "email", "name", "roles"],
"additionalProperties": false,
"properties": {
"userId": { "type": "string", "format": "uuid" },
"email": { "type": "string", "format": "email" },
"name": { "type": "string" },
"roles": { "type": "array", "items": { "type": "string" } }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.core.idp.contact.v1.0~"
}
"userId": { "type": "string", "format": "uuid" },
"email": { "type": "string", "format": "email" },
"name": { "type": "string" },
"roles": { "type": "array", "items": { "type": "string" } }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.core.idp.contact.v1.0~"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,7 @@
"tenantId",
"occurredAt"
],
"x-gts-traits-schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"topicRef": {
"description": "ID of the topic where events of this type are stored.",
"type": "string",
"x-gts-ref": "gts.x.core.events.topic.v1~"
}
}
},
"x-gts-traits-schema": "gts://gts.x.core.traits.event_meta.v1~",
"properties": {
"$schema": {
"description": "Link to the event type schema.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
"title": "Event Instance Schema (Combined Anonymous Instance ID): order.placed",
"type": "object",
"allOf": [
{ "$ref": "gts://gts.x.core.events.type_combined.v1~" },
{
{ "$ref": "gts://gts.x.core.events.type_combined.v1~" }
],
"required": ["payload", "subjectType"],
"x-gts-traits": {
"topicRef": "gts.x.core.events.topic.v1~x.commerce._.orders.v1"
},
"properties": {
"id": {
"type": "string",
"x-gts-ref": "gts.x.core.events.type_combined.v1~x.commerce.orders.order_placed.v1.0~*"
},
"payload": {
"type": "object",
"required": ["payload", "subjectType"],
"required": ["orderId", "customerId", "totalAmount", "items"],
"properties": {
"id": {
"type": "string",
"x-gts-ref": "gts.x.core.events.type_combined.v1~x.commerce.orders.order_placed.v1.0~*"
},
"payload": {
"type": "object",
"required": ["orderId", "customerId", "totalAmount", "items"],
"properties": {
"orderId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string", "format": "uuid" },
"totalAmount": { "type": "number" },
"items": { "type": "array", "items": { "type": "object" } }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.commerce.orders.order.v1.0~"
}
"orderId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string", "format": "uuid" },
"totalAmount": { "type": "number" },
"items": { "type": "array", "items": { "type": "object" } }
}
},
"subjectType": {
"type": "string",
"x-gts-ref": "gts.x.commerce.orders.order.v1.0~"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@
"title": "User",
"type": "object",
"allOf": [
{ "$ref": "gts://gts.x.core.idp.contact.v1.0~" },
{
{ "$ref": "gts://gts.x.core.idp.contact.v1.0~" }
],
"properties": {
"custom_properties": {
"type": "object",
"required": ["phone_number", "address", "currency"],
"properties": {
"custom_properties": {
"type": "object",
"required": ["phone_number", "address", "currency"],
"properties": {
"phone_number": { "type": "string" },
"address": { "type": "string" },
"currency": { "type": "string" }
},
"additionalProperties": true
}
}
"phone_number": { "type": "string" },
"address": { "type": "string" },
"currency": { "type": "string" }
},
"additionalProperties": true
}
]
}
}
20 changes: 20 additions & 0 deletions examples/events/types/gts.x.core.traits.event_meta.v1~.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$id": "gts://gts.x.core.traits.event_meta.v1~",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Event Meta Trait",
"type": "object",
"description": "Trait-type attached to event host-types. Carries cross-cutting metadata: where instances of the event are published (topicRef) and how long they are retained.",
"properties": {
"topicRef": {
"description": "GTS ID of the topic/stream where events of this type are published.",
"type": "string",
"x-gts-ref": "gts.x.core.events.topic.v1~",
"default": "gts.x.core.events.topic.v1~x.core._.default.v1"
},
"retention": {
"description": "ISO 8601 duration for event retention.",
"type": "string",
"default": "P30D"
}
}
}
Loading
Loading