{"schema_version":"1.0","publisher":"Primitive SDKs","canonical_url":"https://test.abhinandan.one/operation-manifest","markdown_url":"https://test.abhinandan.one/operation-manifest.md","article":{"id":"d8fc4f2e-2d6b-41e7-8715-2c95b4c33afc","article_slug":"operation-manifest","parent_article_slug":null,"parent_article_title":null,"kind":"reference","published_at":"2026-08-11T18:55:06.273773+00:00","keywords":["operationManifest","PrimitiveOperationManifest","PrimitiveParameterManifest","requestSchema","responseSchema","operations.generated.ts"],"meta_description":"Reference for the operationManifest array's PrimitiveOperationManifest and PrimitiveParameterManifest fields, generated from openapi/primitive-api.yaml.","og_image_url":null,"source_file_paths":["packages/api-core/scripts/generate-openapi-artifacts.ts","packages/api-core/src/index.ts"],"recording_id":null,"replayable":false,"task_name":"Operation Manifest Reference","category":"API Core / OpenAPI Generation","summary":null,"description":"The operationManifest is a generated array with one entry per OpenAPI operation, carrying its command name, HTTP method, path, parameters, and inlined request/response JSON Schemas for tooling to consume without re-parsing the spec.","content_kind":"repo_page","content_markdown":"## What the operation manifest is\n\n`operationManifest` is a generated TypeScript array with one entry per OpenAPI operation in `openapi/primitive-api.yaml`, exported from `@primitivedotdev/api-core` and re-exported by `@primitivedotdev/sdk/api`. Each entry (`PrimitiveOperationManifest`) carries what a caller needs to invoke and describe that operation: command name, HTTP method, path, path/query parameters, and inlined request/response JSON Schemas.\n\nThe CLI's generic `api-command` shortcut and its `describe`/`list-operations` helpers are built on this manifest; see [Direct API Access and Generic Commands](cli-generic-api-access). This page documents the manifest's shape.\n\nImport it directly when you need the raw metadata:\n\n```typescript\nimport { operationManifest } from \"@primitivedotdev/sdk/api\";\n\nfor (const operation of operationManifest) {\n  console.log(operation.command, operation.method, operation.path);\n}\n\nconst entry = operationManifest.find((op) => op.operationId === \"getAccount\");\nconsole.log(entry?.method, entry?.path, entry?.hasJsonBody);\n```\n\n## Where it comes from\n\n`generate-openapi-artifacts.ts` writes `operationManifest` to `packages/api-core/src/openapi/operations.generated.ts`, building it from the raw (pre-normalization) OpenAPI document rather than the codegen JSON. Entries are sorted by `tagCommand`, then by `command`. It regenerates whenever you run the codegen pipeline; see [Regenerating SDK Code from the OpenAPI Spec](codegen-workflow). Never edit `operations.generated.ts` by hand.\n\n## `PrimitiveOperationManifest` fields\n\n| Field | Type | Description |\n|---|---|---|\n| `operationId` | `string` | The OpenAPI `operationId` verbatim (e.g. `sendEmail`). |\n| `sdkName` | `string` | Same value as `operationId`; the name generated SDK functions use. |\n| `command` | `string` | Kebab-case form of `operationId` (e.g. `send-email`), used as the CLI command name. |\n| `tag` | `string` | The operation's first OpenAPI tag (e.g. `Sending`), or `\"default\"` if untagged. |\n| `tagCommand` | `string` | Kebab-case form of `tag`, used to group CLI commands. |\n| `method` | `string` (`\"GET\"`, `\"POST\"`, `\"PUT\"`, `\"PATCH\"`, `\"DELETE\"`, `\"HEAD\"`, `\"OPTIONS\"`) | Uppercased HTTP method. |\n| `path` | `string` | The OpenAPI path template, including `{param}` placeholders (e.g. `/emails/{id}/reply`). |\n| `summary` | `string \\| null` | The OpenAPI `summary`, or `null` if absent. |\n| `description` | `string \\| null` | The OpenAPI `description`, or `null` if absent. |\n| `pathParams` | `PrimitiveParameterManifest[]` | Parameters with `in: path`. |\n| `queryParams` | `PrimitiveParameterManifest[]` | Parameters with `in: query`. |\n| `hasJsonBody` | `boolean` | `true` when the operation declares an `application/json` request body. |\n| `bodyRequired` | `boolean` | `true` when that request body is marked `required` in the spec. |\n| `requestSchema` | `Record<string, unknown> \\| null` | Inlined JSON Schema for the request body, or `null` when `hasJsonBody` is `false`. |\n| `responseSchema` | `Record<string, unknown> \\| null` | Inlined JSON Schema for the 200/201 response's `data` payload, or `null` if the operation has no 200/201 JSON response. |\n| `binaryResponse` | `boolean` | `true` when any response uses `application/octet-stream`, `application/gzip`, `message/rfc822`, or `format: binary`. |\n\n## `PrimitiveParameterManifest` fields\n\nEach entry in `pathParams` / `queryParams` describes one parameter: its name, schema type, whether it's required, and any enum, default, or numeric bounds the spec declares.\n\n\n| Field | Type | Description |\n|---|---|---|\n| `name` | `string` | The parameter name. |\n| `type` | `string` | The parameter's OpenAPI schema `type` (defaults to `\"string\"` if unspecified). |\n| `required` | `boolean` | Whether the parameter is required. |\n| `description` | `string \\| null` | The parameter's OpenAPI description, or `null`. |\n| `enum` | `string[] \\| null` | Allowed string values, or `null` if the schema has no `enum`. |\n| `default` | `boolean \\| number \\| string` (optional) | The schema's `default` value, present only when the spec declares one. |\n| `minimum` | `number` (optional) | Present only when the schema declares a numeric `minimum`. |\n| `maximum` | `number` (optional) | Present only when the schema declares a numeric `maximum`. |\n\nPath and query parameters are merged from both the path-item level and the operation level before being split into `pathParams` / `queryParams`, so an operation inherits any parameters declared once for the whole path.\n\n## `requestSchema` and `responseSchema`: fully inlined\n\nBoth schema fields have every `$ref` into `components/schemas` and `components/parameters` recursively resolved and inlined, so a consumer never needs to re-parse the OpenAPI document to understand a shape. Cyclic references are broken by leaving the cyclic occurrence as a bare `{ $ref: \"...\" }` rather than recursing forever.\n\n```bash\nprimitive list-operations | jq '.[] | select(.command == \"send-email\") | .requestSchema'\n```\n\n`responseSchema` targets the useful part of the response: the spec writes success responses as `allOf: [SuccessEnvelope, { properties: { data: <real schema> } }]` (or the `ListEnvelope` equivalent). The generator walks that `allOf` and returns the inlined `<real schema>` directly, stripping the uniform `{ success, data, meta }` envelope. If an operation stops following that idiom, `responseSchema` falls back to the full inlined response schema rather than `null`, since a partial schema is more useful to a caller than none.\n\n## Binary responses\n\n`binaryResponse` is `true` for any operation whose responses declare a byte-stream media type or a `format: binary` schema:\n\n- `application/octet-stream`\n- `application/gzip`\n- `message/rfc822`\n- any response media type schema with `format: binary`\n\nUse this to decide whether to parse a response as JSON or handle it as a byte stream (for example raw email downloads or payload pulls).\n\n## Inspecting a live entry\n\nTo see the real values for any operation, dump its entry from the CLI rather than transcribing it by hand:\n\n```bash\nprimitive list-operations | jq '.[] | select(.tagCommand == \"sending\")'\n```\n\n## Related exports from `api-core`\n\n`@primitivedotdev/api-core` (bundled inline into `@primitivedotdev/sdk` and `primitive`; see [What is API Core?](api-core-overview)) also exports:\n\n- `openapiDocument`, the full raw OpenAPI document as a `Record<string, unknown>` constant, generated alongside the manifest.\n- `operations`, a namespace object of every generated SDK operation function, keyed by `operationId` (mirrors the historical shape the CLI's generic command path relies on).\n- `PrimitiveApiClient`, `PrimitiveApiError`, the host-aware request client and its typed error; see [PrimitiveApiClient](primitive-api-client).\n- `isMemoryJsonValue`, a validator for Primitive Memories values; see [Memory Value Validation Helper](memory-json-value-helper).\n\n## Next steps\n\n<CardGroup cols={2}>\n\n<Card title=\"Direct API Access and Generic Commands\" href=\"cli-generic-api-access\">\n\nDrive the operation manifest from the terminal with api-command, list-operations, and describe.\n\n</Card>\n\n<Card title=\"PrimitiveApiClient\" href=\"primitive-api-client\">\n\nConstruct the host-aware client that executes operations named in the manifest.\n\n</Card>\n\n<Card title=\"Regenerating SDK Code from the OpenAPI Spec\" href=\"codegen-workflow\">\n\nRun the pipeline that regenerates operations.generated.ts after a spec change.\n\n</Card>\n\n<Card title=\"Codegen Artifact Generation Scripts\" href=\"api-core-generation-scripts\">\n\nSee what generate-openapi-artifacts.ts and fix-generated-api-imports.ts each produce.\n\n</Card>\n\n</CardGroup>","canonical_base_url":"https://test.abhinandan.one","seo_indexing_enabled":true,"last_modified":"2026-08-21T18:22:43.359885+00:00","video_url":null,"voiceover_url":null,"tools_used":[],"demonstrated_by":[],"steps":[],"related_links":[],"intro":null,"prerequisites":[],"verification":[],"troubleshooting":[],"suggest_edit_url":"https://github.com/abhi-browzer/primitive-sdks/edit/main/packages/api-core/scripts/generate-openapi-artifacts.ts","raise_issue_url":"https://github.com/abhi-browzer/primitive-sdks/issues/new?title=Docs+feedback%3A+Operation+Manifest+Reference&body=Page%3A+https%3A%2F%2Ftest.abhinandan.one%2Foperation-manifest","page_feedback_enabled":true,"verified_ref":null,"verified_at":"2026-08-11T18:38:45.205849+00:00"}}