{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://cpobjects.mycpl.net/schema/user.json", "title": "User", "description": "User data schema", "type": "object", "properties": { "token": { "type": "string" }, "type": { "enum": ["user", "user_external", "aibot"] } }, "required": ["token", "type"], "oneOf": [ { "title": "User", "properties": { "type": { "const": "user" }, "email": { "type": "string", "format": "email" }, "phone": { "type": "string", "pattern": "^\\+.*$" } } }, { "title": "User External", "properties": { "type": { "const": "user_external" }, "email": { "type": "string", "format": "email" }, "phone": { "type": "string", "pattern": "^\\+.*$" } } }, { "title": "Bot User", "properties": { "type": { "const": "aibot" }, "version": { "type": "string" } }, "required": ["version"] } ], "discriminator": { "propertyName": "type" } }