-
Notifications
You must be signed in to change notification settings - Fork 14
examples: fix examples and make it compliant with the latest specification #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "id": "gts.x.core.events.topic.v1~x.core._.default.v1", | ||
| "name": "default", | ||
| "description": "Default platform event topic. Used when an event type does not declare a specific topicRef trait.", | ||
| "retention": "P30D", | ||
| "ordering": "global", | ||
| "partitions": 1, | ||
| "dedup": { "strategy": "none" }, | ||
| "storage": { "kind": "db", "config": { "table": "events_default" } } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,33 @@ | ||
| [ | ||
| // Platform-scope default: new dashboard is disabled platform-wide. | ||
| // Per-user default at platform scope: new dashboard disabled for this user. | ||
| { | ||
| "type": "gts.x.core.settings.type.v1~x.platform._.feature_new_dashboard.v1~", | ||
| "tenant_id": "00000000-0000-0000-0000-000000000000", | ||
| "subject_type": "gts.x.core.idp.user.v1~", | ||
| "subject_id": "f0e1d2c3-b4a5-6789-0123-456789abcdef", | ||
| "value": { | ||
| "enabled": false | ||
| } | ||
| }, | ||
| // Platform-scope override: platform administrator has enabled the new dashboard globally. | ||
| // Per-user override at platform scope: platform admin has opted in. | ||
| { | ||
| "type": "gts.x.core.settings.type.v1~x.platform._.feature_new_dashboard.v1~", | ||
| "tenant_id": "00000000-0000-0000-0000-000000000000", | ||
| "subject_type": "gts.x.core.idp.user.v1~", | ||
| "subject_id": "a1b2c3d4-e5f6-7890-abcd-000000000001", | ||
| "value": { | ||
| "enabled": true | ||
| } | ||
| }, | ||
| // Tenant-scope override: tenant 'acme-corp' has opted out while the platform default is true. | ||
| // Cascading — this tenant and its non-overriding descendants see enabled=false. | ||
| { | ||
| "type": "gts.x.core.settings.type.v1~x.platform._.feature_new_dashboard.v1~", | ||
| "tenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", | ||
| "value": { | ||
| "enabled": false | ||
| } | ||
| }, | ||
| // Subject-scoped override: setting attached to a specific user within tenant 'acme-corp'. | ||
| // subject_type is a GTS type reference; subject_id identifies the user. | ||
| // Per-user override at tenant scope: user within tenant 'acme-corp' has opted out | ||
| // while the cascading default is true. | ||
| { | ||
| "type": "gts.x.core.settings.type.v1~x.platform._.feature_new_dashboard.v1~", | ||
| "tenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", | ||
| "subject_type": "gts.x.core.idp.user.v1~", | ||
| "subject_id": "f0e1d2c3-b4a5-6789-0123-456789abcdef", | ||
| "value": { | ||
| "enabled": true | ||
| "enabled": false | ||
| } | ||
| } | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,4 +75,4 @@ | |
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,11 +6,11 @@ | |
| "description": "Base type for all VM power states. Final: no derived types allowed.", | ||
| "type": "object", | ||
| "required": [ | ||
| "gtsId", | ||
| "id", | ||
| "description" | ||
| ], | ||
| "properties": { | ||
| "gtsId": { | ||
| "id": { | ||
|
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Synchronize the TypeSpec source before renaming the schema property.
🤖 Prompt for AI Agents |
||
| "type": "string", | ||
| "description": "GTS identifier of the power state type", | ||
| "x-gts-ref": "/$id" | ||
|
|
@@ -28,4 +28,4 @@ | |
| "description": "Icon name for UI representation (optional)" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "$id": "gts://gts.x.core.idp.user.v2~", | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "x-gts-abstract": true, | ||
| "title": "User (Base)", | ||
| "description": "Abstract base type for platform user identities. Derived types add vendor- or role-specific fields via the open 'properties' container.", | ||
| "type": "object", | ||
| "required": ["id", "type", "tenant_id", "email", "display_name", "status"], | ||
| "properties": { | ||
| "id": { | ||
| "description": "Unique user identifier.", | ||
| "type": "string", | ||
| "format": "uuid" | ||
| }, | ||
| "type": { | ||
| "description": "GTS Type Identifier of this user.", | ||
| "type": "string", | ||
| "x-gts-ref": "/$id" | ||
| }, | ||
| "tenant_id": { | ||
| "description": "UUID of the tenant this user belongs to.", | ||
| "type": "string", | ||
| "format": "uuid" | ||
| }, | ||
| "email": { | ||
| "description": "Primary email address.", | ||
| "type": "string", | ||
| "format": "email" | ||
| }, | ||
| "display_name": { | ||
| "description": "Human-readable display name.", | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "maxLength": 200 | ||
| }, | ||
| "status": { | ||
| "description": "Account lifecycle status. Backward incompatible change from v1.", | ||
| "type": "string", | ||
| "enum": ["active", "inactive", "suspended", "deleted"] | ||
| }, | ||
| "created_at": { | ||
| "description": "Timestamp when the user was created.", | ||
| "type": "string", | ||
| "format": "date-time" | ||
| }, | ||
| "updated_at": { | ||
| "description": "Timestamp of the last update.", | ||
| "type": "string", | ||
| "format": "date-time" | ||
| }, | ||
| "properties": { | ||
| "description": "Extension point for derived types. Vendor- or role-specific fields go here.", | ||
| "type": "object" | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the cascade example consistent.
The
cascadingcontract inherits the platform value and permits tenant overrides. Userf0e1d2c3-b4a5-6789-0123-456789abcdefhasenabled: falseat both scopes, so this example does not show an opt-out from a true platform value. Set the platform entry totrue, or target the user whose platform entry is alreadytrue.🤖 Prompt for AI Agents