{
 "$schema":"https://json-schema.org/draft/2020-12/schema",
 "$id":"urn:heyso:saas:application-manifest:1.0.0",
 "title":"HeySO SaaS application manifest 1.0.0",
 "type":"object","additionalProperties":false,
 "required":["contractVersion","id","name","description","launchUrl","redirectUris","secretEnv","scopes","scope","status"],
 "properties":{
  "contractVersion":{"const":"1.0.0"},
  "id":{"type":"string","pattern":"^[a-z][a-z0-9-]{1,47}$","not":{"const":"heyso"}},
  "name":{"type":"string","minLength":1,"maxLength":80},
  "description":{"type":"string","maxLength":500},
  "launchUrl":{"type":"string","format":"uri","pattern":"^https://"},
  "redirectUris":{"type":"array","minItems":1,"maxItems":8,"uniqueItems":true,"items":{"type":"string","format":"uri","pattern":"^https://"}},
  "secretEnv":{"type":"string","pattern":"^HEYSO_APP_[A-Z0-9_]+_SECRET$"},
  "scopes":{"type":"array","uniqueItems":true,"contains":{"const":"identity.read"},"items":{"enum":["identity.read","data.read","data.write","app.manage"]}},
  "scope":{"enum":["tenant","project"]},"status":{"enum":["active","disabled"]}
 },
 "description":"Server additionally checks URL credentials/fragments, redirect origin equality, unique credential environment references and readiness before activation. Classification category and authorizationMode are platform-owned response fields and are not accepted in manifests. Official applications require a platform-deployed native adapter; third-party applications require user consent and PKCE."
}
