Skip to content

Spec extensions and naming

Use this when the spec alone doesn't give oryva what you want, such as a package name, pagination or agent hints, or when a generated name surprises you. Every extension is optional: a spec without any of them still generates a complete SDK.

Where Extension Meaning
info x-oryva-name Package stem, e.g. ledger. Default: snake_case of the title's first word, skipping "The", "A" or "An".
info x-oryva-idempotency-header Header for automatic idempotency keys, e.g. Idempotency-Key.
info x-oryva-webhook-signing: standard-webhooks Webhooks are signed per standardwebhooks.com.
info x-oryva-gateway Hosted mode for the MCP server: sign_in (scheme, or a mapping of schemes sent together to their field labels, label, help, and optionally connect: url of your app's sign-in-and-approve page, exchange operationId that trades {grant} for the credential with no auth, credential dotted path into its response), identity (operation, display), bind (parameter → dotted path into the identity response), tools.tags. Settings come from ORYVA_GATEWAY_SECRET, ORYVA_GATEWAY_URL and ORYVA_GATEWAY_CONNECT_URL (overrides connect.url); see Hosted mode.
info x-oryva-chat A Slack app for hosted mode; needs x-oryva-gateway. See below.
server x-oryva-name Environment name. Default: first label of the host, then environment_<n> on collision.
security scheme x-oryva-env The environment variable an API key or token is read from; the client argument is its name without <NAME>_, in lower case.
operation x-oryva-resource, x-oryva-method Override the derived names. A dotted resource (customers.notes) is nested under its parent in Python, TypeScript, Go, Java, Kotlin and C#.
operation x-oryva-agent read_only, destructive, idempotent, hint, examples.
operation x-oryva-pagination style: cursor (param, next_cursor, items), style: offset (offset_param, limit_param, items) or style: page (page_param, items). Paths are lists of field names.

x-oryva-chat

A Slack app beside the hosted server. Each person connects their own account once; from then on the app acts as them. It sends one message a day with the best few new items, each with a button that deals with it in Slack, and Undo; urgent items go out at once. Its Home tab shows what is waiting, progress and what they finished this week. Claude answers their DMs with the hosted tools.

x-oryva-chat:
  name: Tickets
  feed:
    operation: tickets_list_open       # a hosted tool that needs only bound inputs
    items: data
    total: meta.total
    every: 15m
    priority: {field: severity, order: [p1, p2, p3], urgent: [p1]}
    digest:
      at: "09:00"
      days: weekdays
      limit: 3
      prefer: one_click
      group: queue.name
      header: "{count} tickets to close in {group}."
      finished: "All done. {left} more are waiting when you have time."
    card:
      id: id
      title: subject
      text: summary
      context: customer.name
      link: url
      preview: {before: suggestion.before, after: suggestion.after}
    apply:
      when: one_click
      label: suggestion.label
      choices: suggestion.choices
      operation: tickets_apply_suggestion
      args: {ticketId: "{id}"}
      done: "{result.label}"
      undo: {operation: tickets_revert_suggestion, args: {ticketId: "{id}"}, done: Reverted.}
    actions:
      - {label: Snooze a day, operation: tickets_snooze, args: {ticketId: "{id}", days: 1}, done: Snoozed until tomorrow.}
  home:
    stats:
      - operation: queues_health
        items: data
        title: name
        progress: {done: answered, of: total, label: "{answered} of {total} answered"}
        action:
          when: overdue
          label: "Escalate {overdue}"
          operation: queues_escalate
          args: {queueId: "{id}"}
          done: "Escalated {result.count} tickets."
  ask:
    instructions: You help support agents with their queue.
    prompts: [What is overdue?, Summarise today's p1s]

Paths are dotted field names from the root of an item (or a row, for home.stats). Text marked "template" may hold {path}s into the item; done texts may also hold {result.path}s into what the call returned. Every key is checked against the spec, and an error names the key.

  • name: the app's name, at most 35 characters.
  • feed: a list operation's items, sent to each person.
    • operation, items (path to the list in the response), optionally total (path to the full count, when the list returns a first page), every (30s, 15m, 1h: how often the app looks for urgent items and for whose digest is due).
    • priority: field (path), order (values, first to last; others come after), and optionally urgent (values whose items go out at once, each on its own).
    • digest, every key optional: at (HH:MM in each person's Slack time zone, default 09:00; people change theirs on the Home tab), days (daily, the default, weekdays, or a list such as [mon, thu]), limit (cards per message, 1 to 10, default 3), prefer (path to a flag: those items first), group (path: one digest holds items of one group, the group of the best item), header (template with {count} and {group}, default {count} waiting for you.), finished (replaces the header once every card is dealt with: {count}, {group}, {left}). A digest goes out once a day at at, and only when something is new. On connecting, the first digest is the welcome.
    • card: paths to id and title, and optionally text, context, link (opened by Open) and preview (before, after, shown as before → after).
    • apply, optional, the card's main button: operation, args (a value of "{path}" comes from the item), done (template), and optionally when (path to a flag: other items get Open as their main button), label (path to the button's label; for items that can't be applied, to the Open button's), choices (path to [{label, value}]: one button each, which sends its value as the operation's choice input) and undo (operation, args, done, optionally label). An applied card turns into its done text with Undo; a 409 from the operation says the item changed since it was found and keeps Open.
    • actions, optional, at most 5, under the card's More menu: label (template), operation, args, done, and optionally when.
  • home.stats, optional: rows on the Home tab, each from a list operation: operation, items, title (path), optionally progress (done and of paths, drawn as a bar, and a label template) and action (as under actions; its button shows where when holds). A finished digest offers the first stat action whose when holds.
  • ask, optional: instructions for Claude, and prompts, questions offered as buttons the first time someone opens the app's messages (at most 75 characters each). Claude asks before calling a tool that changes something.

feed, ask or both are required. Settings come from SLACK_CLIENT_ID and SLACK_CLIENT_SECRET (people sign in with Slack before they connect, and any workspace adds the app at /slack/install), SLACK_BOT_TOKEN (a workspace without /slack/install), SLACK_APP_TOKEN or SLACK_SIGNING_SECRET, SLACK_API_URL, ORYVA_CHAT_DB (a SQLite file, or a Postgres URL that several instances share), ANTHROPIC_API_KEY and ORYVA_CHAT_MODEL; see Environment variables. The generated slack-manifest.json asks for chat:write and im:write, im:history with ask, and users:read with feed, for each person's time zone, and for the user scope openid, for Sign in with Slack.

Naming

How oryva derives names from a spec. Every language applies its own casing to the same names.

  • Resource: the operation's first tag in snake_case; with no tag, the first static path segment.
  • Model: the components.schemas key in PascalCase. A key already in PascalCase keeps its spelling (GrowthURLs).
  • Method: operationId in snake_case with a leading <resource>_ stripped (customers_list under tag customers → list). With no operationId: GET on a path ending in a parameter → get, other GET → list, POST → create, PUT/PATCH → update, DELETE → delete. Two operations mapping to the same resource+method is a parse error naming both.
  • oryva.yml can set the same names per operation, and rename models, without editing the spec; see oryva.yml.
  • Path parameters: the path's last parameter is passed by position, the others by name: in Python client.projects.keys.get("key_1", project_id="proj_1"), in TypeScript client.projects.keys.get('key_1', { project_id: 'proj_1' }).
  • Go names create and retrieve New and Get (create_variation → NewVariation), as Stainless's Go SDKs do. Params types take the resource in the singular: CustomerNewParams in Go, CustomerCreateParams in Java and Kotlin; Go adds a nested resource's parents (ChatCompletionNewParams), Java and Kotlin only when another resource has the same name.
  • Hoisted inline objects: request bodies → <Resource><Method>Request, 2xx responses → <Resource><Method>Response, nested inline objects → <Parent><Field> (all PascalCase).
  • Agent defaults: GET → read_only + idempotent; PUT → idempotent; DELETE → destructive + idempotent; POST/PATCH → none. x-oryva-agent keys override individually.
  • Env vars, with <NAME> the upper snake API name: webhooks <NAME>_WEBHOOK_SECRET; base URL <NAME>_BASE_URL. Credentials, when the API has one auth scheme: API key and http token <NAME>_API_KEY; basic auth <NAME>_USERNAME / <NAME>_PASSWORD; OAuth2 <NAME>_CLIENT_ID / <NAME>_CLIENT_SECRET / <NAME>_OAUTH_TOKEN_URL. With several schemes, each gets its own, with <IDENT> the scheme's key in upper snake case: <NAME>_<IDENT>, <NAME>_<IDENT>_USERNAME, <NAME>_<IDENT>_CLIENT_ID, <NAME>_<IDENT>_TOKEN_URL and so on. Two schemes that would share a variable are a parse error.
  • Credential arguments: the env var without <NAME>_, in the language's case (service_key=, service_key: in Ruby, serviceKey, with TypeScript's token URLs ending in URL); a single OAuth2 scheme's token URL is token_url= / token_url: / tokenURL / tokenUrl in PHP.
  • Webhook ident: the event name in snake_case with dots as underscores (invoice.paid → invoice_paid).
  • Client class: PascalCase API name in Python (Ledger, async AsyncLedger), TypeScript, Java and Kotlin; LedgerClient in C#, where a class can't share its namespace's name; Client in Go, Rust, Ruby and PHP, where the package, crate, module or namespace already names the API (ledger.Client, Ledger::Client, Ledger\Client). The Python and TypeScript targets' client option renames it. Resources are attributes (client.customers.list(...)), camelCase in TypeScript. Python keywords get a trailing underscore (from_); a Python parameter named like a request option gets api_ in front (api_timeout).
  • TypeScript models are exported from the package and also reachable on the client's namespace (Ledger.Customer).
  • MCP tool names: <resource>_<method> (customers_list).