You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
5.8 KiB
120 lines
5.8 KiB
|
24 hours ago
|
{
|
||
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
|
|
"$id": "urn:juegoland:shared-models:1",
|
||
|
|
"$ref": "#/$defs/ErrorData",
|
||
|
|
"$defs": {
|
||
|
|
"UUID": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" },
|
||
|
|
"Revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
|
||
|
|
"Instant": { "type": "string", "format": "date-time", "pattern": "Z$" },
|
||
|
|
"Locale": { "type": "string", "minLength": 2, "maxLength": 64, "pattern": "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$" },
|
||
|
|
"ErrorCode": { "type": "string", "minLength": 2, "maxLength": 64, "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$" },
|
||
|
|
"MessageArgument": { "type": ["string", "number", "boolean"], "maxLength": 256, "minimum": -9007199254740991, "maximum": 9007199254740991 },
|
||
|
|
"MessageArgs": {
|
||
|
|
"type": "object", "maxProperties": 12,
|
||
|
|
"propertyNames": { "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,31}$" },
|
||
|
|
"additionalProperties": { "$ref": "#/$defs/MessageArgument" }
|
||
|
|
},
|
||
|
|
"LocalizedMessage": {
|
||
|
|
"type": "object", "additionalProperties": true, "required": ["key", "args"],
|
||
|
|
"properties": {
|
||
|
|
"key": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)*$" },
|
||
|
|
"args": { "$ref": "#/$defs/MessageArgs" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"ErrorOrigin": { "type": "string", "enum": ["server", "client", "transport"] },
|
||
|
|
"ErrorCategory": { "type": "string", "enum": ["validation", "authentication", "authorization", "not-found", "conflict", "rate-limit", "availability", "internal", "protocol", "transport"] },
|
||
|
|
"OperationOutcome": { "type": "string", "enum": ["not-applicable", "not-applied", "rejected", "unknown"] },
|
||
|
|
"RecoveryAction": { "type": "string", "enum": ["none", "correct-input", "authenticate", "complete-requirements", "resync", "resolve-pending", "retry-same-request", "change-selection", "update-client", "contact-support"] },
|
||
|
|
"Recovery": {
|
||
|
|
"type": "object", "additionalProperties": true, "required": ["action"],
|
||
|
|
"properties": {
|
||
|
|
"action": { "$ref": "#/$defs/RecoveryAction" },
|
||
|
|
"retryAfterMs": { "type": "integer", "minimum": 0, "maximum": 86400000 }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"Violation": {
|
||
|
|
"type": "object", "additionalProperties": true, "required": ["pointer", "code", "message"],
|
||
|
|
"properties": {
|
||
|
|
"pointer": { "type": "string", "maxLength": 256, "pattern": "^(?:/(?:[^~/]|~[01])*)*$" },
|
||
|
|
"code": { "$ref": "#/$defs/ErrorCode" },
|
||
|
|
"message": { "$ref": "#/$defs/LocalizedMessage" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"ErrorData": {
|
||
|
|
"type": "object", "additionalProperties": true,
|
||
|
|
"required": ["modelVersion", "origin", "code", "category", "outcome", "message", "recovery", "violations"],
|
||
|
|
"properties": {
|
||
|
|
"modelVersion": { "type": "integer", "const": 1 },
|
||
|
|
"origin": { "$ref": "#/$defs/ErrorOrigin" },
|
||
|
|
"code": { "$ref": "#/$defs/ErrorCode" },
|
||
|
|
"category": { "$ref": "#/$defs/ErrorCategory" },
|
||
|
|
"outcome": { "$ref": "#/$defs/OperationOutcome" },
|
||
|
|
"message": { "$ref": "#/$defs/LocalizedMessage" },
|
||
|
|
"recovery": { "$ref": "#/$defs/Recovery" },
|
||
|
|
"violations": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/Violation" } }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"Correlation": {
|
||
|
|
"type": "object", "additionalProperties": true,
|
||
|
|
"properties": {
|
||
|
|
"requestId": { "$ref": "#/$defs/UUID" },
|
||
|
|
"commandId": { "$ref": "#/$defs/UUID" },
|
||
|
|
"operationId": { "$ref": "#/$defs/UUID" },
|
||
|
|
"subscriptionId": { "$ref": "#/$defs/UUID" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"HttpProblem": {
|
||
|
|
"type": "object", "additionalProperties": true,
|
||
|
|
"required": ["type", "title", "status", "correlation", "error"],
|
||
|
|
"properties": {
|
||
|
|
"type": { "type": "string", "pattern": "^urn:juegoland:problem:[a-z][a-z0-9-]{1,63}$" },
|
||
|
|
"title": { "type": "string", "minLength": 1, "maxLength": 256 },
|
||
|
|
"status": { "type": "integer", "minimum": 400, "maximum": 599 },
|
||
|
|
"correlation": { "$ref": "#/$defs/Correlation" },
|
||
|
|
"error": { "$ref": "#/$defs/ErrorData" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"ErrorMessagePayload": {
|
||
|
|
"type": "object", "additionalProperties": true, "required": ["correlation", "error"],
|
||
|
|
"properties": {
|
||
|
|
"correlation": { "$ref": "#/$defs/Correlation" },
|
||
|
|
"error": { "$ref": "#/$defs/ErrorData" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"CommandRejection": {
|
||
|
|
"type": "object", "additionalProperties": true, "required": ["status", "error"],
|
||
|
|
"properties": {
|
||
|
|
"status": { "type": "string", "const": "rejected" },
|
||
|
|
"error": { "$ref": "#/$defs/ErrorData" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"GameCard": {
|
||
|
|
"type": "object", "additionalProperties": true,
|
||
|
|
"required": ["id", "version", "title", "summary", "locale", "minPlayers", "maxPlayers"],
|
||
|
|
"properties": {
|
||
|
|
"id": { "type": "string", "minLength": 1, "maxLength": 64 },
|
||
|
|
"version": { "type": "string", "minLength": 1, "maxLength": 64 },
|
||
|
|
"title": { "type": "string", "minLength": 1, "maxLength": 256 },
|
||
|
|
"summary": { "type": "string", "maxLength": 2048 },
|
||
|
|
"locale": { "$ref": "#/$defs/Locale" },
|
||
|
|
"minPlayers": { "type": "integer", "minimum": 1, "maximum": 64 },
|
||
|
|
"maxPlayers": { "type": "integer", "minimum": 1, "maximum": 64 }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"CatalogPage": {
|
||
|
|
"type": "object", "additionalProperties": true, "required": ["items", "nextCursor"],
|
||
|
|
"properties": {
|
||
|
|
"items": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/GameCard" } },
|
||
|
|
"nextCursor": { "type": ["string", "null"], "minLength": 1, "maxLength": 512 }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"CatalogResponse": {
|
||
|
|
"type": "object", "additionalProperties": true, "required": ["requestId", "data"],
|
||
|
|
"properties": {
|
||
|
|
"requestId": { "$ref": "#/$defs/UUID" },
|
||
|
|
"data": { "$ref": "#/$defs/CatalogPage" }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|