Skip to content

Commit

Permalink
Skip serialising empty nones
Browse files Browse the repository at this point in the history
Signed-off-by: lloydmeta <[email protected]>
  • Loading branch information
lloydmeta committed Oct 30, 2024
1 parent 24fea73 commit 06ffc37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ To fulfil the above:

An example Terraform config in `terraform/prod` is provided to show how to deploy at a subdomain using Cloudflare as our (free!) CDN + WAF.

## Usage:

We only support resizing at the moment

1. An "image" endpoint [a la Thumbor](https://thumbor.readthedocs.io/en/latest/usage.html#image-endpoint)
2. A "metadata" endpoint [a la Thumbor](https://thumbor.readthedocs.io/en/latest/usage.html#metadata-endpoint)
* Difference: target image size is _not_ returned (might change in the future)

## Flow

1. Layer 1 validations (is the request well-formed?)
Expand Down
2 changes: 2 additions & 0 deletions server/src/api/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ pub struct Source {
#[derive(Serialize, Deserialize, Eq, PartialEq, Debug)]
pub struct Operation {
pub r#type: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub width: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub height: Option<u32>,
}

Expand Down

0 comments on commit 06ffc37

Please sign in to comment.