DataResponse_AgentCatalogEntry
Generic API response wrapper with optional pagination This wrapper provides a consistent structure for all API responses, making it easier for clients to handle responses uniformly. It supports both single resources and collections, with optional pagination metadata. Publisher endpoints use the same wrapper for non-streaming JSON success responses, including first-class publishers. Streaming endpoints such as SSE responses carry metering in response headers and are not wrapped. Payment-required and error responses are also not wrapped so clients can parse their existing wire contracts directly. # Response Structure ```json { "data": T, "pagination": { ... } // optional } ``` # Examples ## Single Resource ```rust use seren_core::http::DataResponse; use serde::Serialize; #[derive(Serialize)] struct Project { id: String, name: String, } let project = Project { id: "123".to_string(), name: "My Project".to_string(), }; let response = DataResponse::new(project); // Serializes to: {"data": {"id": "123", "name": "My Project"}} ``` ## Collection with Pagination ```rust use seren_core::http::DataResponse; use seren_core::pagination::PaginationMeta; use serde::Serialize; #[derive(Serialize)] struct Project { id: String, name: String, } let projects: Vec<Project> = Vec::new(); let pagination = PaginationMeta { total: 0, count: 0, limit: 20, offset: 0, has_more: false, }; let response = DataResponse::with_pagination(projects, pagination); // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}} ```
Properties
| Property | Type | Required | Description |
|---|---|---|---|
data |
object | Yes | A single catalog entry. The four fields `organization_id`, `namespace`, `name`, and `version` together form the immutable identity of an entry. `tag` is an optional mutable pointer (for example `stable`) that resolves to the underlying version at lookup time. |
pagination |
any | No |
View JSON Schema
{
"type": "object",
"description": "Generic API response wrapper with optional pagination\n\nThis wrapper provides a consistent structure for all API responses,\nmaking it easier for clients to handle responses uniformly. It supports\nboth single resources and collections, with optional pagination metadata.\nPublisher endpoints use the same wrapper for non-streaming JSON success\nresponses, including first-class publishers. Streaming endpoints such as\nSSE responses carry metering in response headers and are not wrapped.\nPayment-required and error responses are also not wrapped so clients can\nparse their existing wire contracts directly.\n\n# Response Structure\n\n```json\n{\n \"data\": T,\n \"pagination\": { ... } // optional\n}\n```\n\n# Examples\n\n## Single Resource\n\n```rust\nuse seren_core::http::DataResponse;\nuse serde::Serialize;\n\n#[derive(Serialize)]\nstruct Project {\n id: String,\n name: String,\n}\n\nlet project = Project {\n id: \"123\".to_string(),\n name: \"My Project\".to_string(),\n};\n\nlet response = DataResponse::new(project);\n// Serializes to: {\"data\": {\"id\": \"123\", \"name\": \"My Project\"}}\n```\n\n## Collection with Pagination\n\n```rust\nuse seren_core::http::DataResponse;\nuse seren_core::pagination::PaginationMeta;\nuse serde::Serialize;\n\n#[derive(Serialize)]\nstruct Project {\n id: String,\n name: String,\n}\n\nlet projects: Vec<Project> = Vec::new();\nlet pagination = PaginationMeta {\n total: 0,\n count: 0,\n limit: 20,\n offset: 0,\n has_more: false,\n};\n\nlet response = DataResponse::with_pagination(projects, pagination);\n// Serializes to: {\"data\": [...], \"pagination\": {\"total\": 0, \"count\": 0, \"limit\": 20, \"offset\": 0, \"has_more\": false}}\n```",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"description": "A single catalog entry. The four fields `organization_id`, `namespace`,\n`name`, and `version` together form the immutable identity of an entry.\n`tag` is an optional mutable pointer (for example `stable`) that resolves\nto the underlying version at lookup time.",
"required": [
"id",
"organization_id",
"namespace",
"name",
"version",
"kind",
"description",
"source",
"labels",
"annotations",
"trust",
"deprecated",
"created_at",
"updated_at"
],
"properties": {
"annotations": {
"description": "Narrative key/value annotations; not indexed and not queryable."
},
"category": {
"type": [
"string",
"null"
]
},
"created_at": {
"type": "string",
"format": "date-time"
},
"created_by_user_id": {
"type": [
"string",
"null"
],
"format": "uuid"
},
"deprecated": {
"type": "boolean"
},
"description": {
"type": "string"
},
"id": {
"type": "string",
"format": "uuid"
},
"kind": {
"$ref": "#/components/schemas/AgentCatalogEntryKind"
},
"labels": {
"description": "Queryable key/value labels (e.g. `team=platform`, `env=prod`)."
},
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"organization_id": {
"type": "string",
"format": "uuid"
},
"requires": {
"$ref": "#/components/schemas/EntryRequires",
"description": "Dependencies this entry requires to be useful. Typed so the control\nplane can validate references at apply time without parsing free-form\nJSON. Stored as JSONB; unknown fields are tolerated on read so a\nschema bump does not invalidate old rows."
},
"source": {
"description": "Where the artifact lives. Free-form JSON so we can evolve the source\nshape (`inline`, `git`, `registry`, ...) without further migrations."
},
"tag": {
"type": [
"string",
"null"
]
},
"trust": {
"description": "Trust and provenance metadata (`author`, `maintained_by`, `license`,\n`last_audit_at`). Free-form for now; concrete shape comes later."
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"version": {
"type": "string"
}
}
},
"pagination": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/PaginationMeta",
"description": "Optional pagination metadata"
}
]
}
}
}