Skip to content

Conversation

@alvarobartt
Copy link
Member

@alvarobartt alvarobartt commented Nov 11, 2025

What does this PR do?

This PR adds #[serde(alias = "...")] to TruncationDirection on HTTP to make sure that the enum variants deserialize from lowercase too e.g. {..., "truncation_direction":"left", ...} as previously it was only deserializing from the enum variant counterpart e.g., Left.

This PR partially fixes #754, but there's still some more issues to tackle as per the openapi.json specification as reported in the issue.

Warning

Rather than removing the "Left" and "Right" values enforcing those to be lowercased, to make sure this is introduced in the best way possible, from now on both variants (lowercase and capitalized) are supported for truncation_direction but only the lowercase will be recommended.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the documentation guidelines.
  • Did you write any new necessary tests? If applicable, did you include or update the insta snapshots?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

cc @Wauplin for visibility!

@alvarobartt alvarobartt added this to the v1.9.0 milestone Nov 11, 2025
With `#[serde(alias = "...", ...)]` we wouldn't break anything
user-wise, whilst allowing for both "left"/"Left" and "right"/"Right" to
be provided as `truncation_direction` other than only the capitalized
version of those
@alvarobartt alvarobartt marked this pull request as ready for review November 14, 2025 07:26
@alvarobartt alvarobartt changed the title Fix TruncationDirection by renaming to lowercase Fix TruncationDirection to deserialize from lowercase and capitalized Nov 14, 2025
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alvarobartt alvarobartt merged commit 106d25f into main Nov 14, 2025
14 checks passed
@alvarobartt alvarobartt deleted the missing-serde-rename-lower branch November 14, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI spec has wrong examples

3 participants