Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/handlers/src/admin/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl PaginationMeta {
pub struct PaginatedResponse<T> {
/// Response metadata
#[serde(skip_serializing_if = "PaginationMeta::is_empty")]
#[schemars(with = "Option<PaginationMeta>")]
meta: PaginationMeta,

/// The list of resources
Expand Down Expand Up @@ -183,6 +184,7 @@ struct SingleResource<T> {

/// Metadata about the resource
#[serde(skip_serializing_if = "SingleResourceMeta::is_empty")]
#[schemars(with = "Option<SingleResourceMeta>")]
meta: SingleResourceMeta,
}

Expand Down
84 changes: 42 additions & 42 deletions docs/api/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3810,13 +3810,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand Down Expand Up @@ -3851,7 +3851,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -3873,7 +3872,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -4132,13 +4132,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand All @@ -4161,7 +4161,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -4183,7 +4182,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -4306,7 +4306,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -4328,7 +4327,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -4387,13 +4387,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand All @@ -4416,7 +4416,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -4438,7 +4437,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -4593,13 +4593,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand All @@ -4622,7 +4622,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -4644,7 +4643,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -4733,13 +4733,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand All @@ -4762,7 +4762,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -4784,7 +4783,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -4875,13 +4875,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand All @@ -4904,7 +4904,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -4926,7 +4925,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -5069,13 +5069,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand All @@ -5098,7 +5098,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -5120,7 +5119,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down Expand Up @@ -5216,13 +5216,13 @@
"description": "A top-level response with a page of resources",
"type": "object",
"required": [
"links",
"meta"
"links"
],
"properties": {
"meta": {
"description": "Response metadata",
"$ref": "#/components/schemas/PaginationMeta"
"$ref": "#/components/schemas/PaginationMeta",
"nullable": true
},
"data": {
"description": "The list of resources",
Expand All @@ -5245,7 +5245,6 @@
"attributes",
"id",
"links",
"meta",
"type"
],
"properties": {
Expand All @@ -5267,7 +5266,8 @@
},
"meta": {
"description": "Metadata about the resource",
"$ref": "#/components/schemas/SingleResourceMeta"
"$ref": "#/components/schemas/SingleResourceMeta",
"nullable": true
}
}
},
Expand Down
Loading