We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
Here is my code:
#[derive(Debug, Serialize, ToSchema)] pub struct SuccessResponsePayload<T: ResourceObject> { #[schema(inline = false)] pub data: Vec<T>, #[schema(ignore = Self::ignore_included)] #[serde(skip_serializing_if = "Option::is_none")] pub included: Option<Vec<T::RelationshipValue>>, #[schema(inline)] pub links: LinksObject<T>, } impl<T: ResourceObject> SuccessResponsePayload<T> { fn ignore_included() -> bool { !T::HAS_RELATIONSHIPS } } #[derive(Debug, Serialize, IntoResponses, ToSchema)] #[serde(untagged)] pub enum Response<T: ResourceObject> { #[response( status = 204, content_type = CONTENT_TYPE, description = "Success response with no content.", )] Empty, #[response( status = 200, content_type = CONTENT_TYPE, description = "Success response." )] Success(#[to_schema] SuccessResponsePayload<T>), #[response( status = "4XX", content_type = CONTENT_TYPE, description = "Client error response.", example = json!(EXAMPLE_ERROR_NOT_FOUND) )] ClientError(#[to_schema] ClientErrorResponse), #[response( status = "5XX", content_type = CONTENT_TYPE, description = "Server error response.", example = json!(EXAMPLE_ERROR_INTERNAL_SERVER_ERROR) )] ServerError(#[to_schema] ServerErrorResponse), }
"responses": { "200": { "description": "Success response.", "content": { "application/vnd.api+json": { "schema": { "type": "object", "required": [ "data", "links" ], "properties": { "data": { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/AccessorSparseIndicesResourceIdentifierObject" }, { "type": "object", "required": [ "attributes", "relationships" ], "properties": { "attributes": { "$ref": "#/components/schemas/AccessorSparseIndicesResourceSparseAttributesObject" }, "relationships": { "$ref": "#/components/schemas/AccessorSparseIndicesResourceSparseRelationshipsObject" } } } ], "description": "An object pointing to a buffer view containing the indices of deviating accessor values. The number of indices is\nequal to `accessor.sparse.count`. Indices **MUST** strictly increase." } },
For some reason, SuccessResponsePayload::data is still inlined despite #1184 .
I will write a specific test for the expected behavior (using $ref) to understand what needs to be changed.
$ref
The text was updated successfully, but these errors were encountered:
@juhaku I would appreciate any input you have on how to resolve this.
I will open a PR ASAP.
Sorry, something went wrong.
Another problem:
#[derive(Debug, serde::Serialize, utoipa::ToResponse)] pub struct #successs_ident(#[to_schema] pub ::jsonapi::response::SuccessResponse<#resource_object_ident>);
As per the documentation, I would expect SuccessResponse<#resource_object_ident> to be inlined. But it is not.
SuccessResponse<#resource_object_ident>
No branches or pull requests
Hello,
Here is my code:
For some reason, SuccessResponsePayload::data is still inlined despite #1184 .
I will write a specific test for the expected behavior (using
$ref
) to understand what needs to be changed.The text was updated successfully, but these errors were encountered: