Skip to content

OpenApi fixes#42

Merged
b4l merged 4 commits intomainfrom
openapi-fixes
Feb 27, 2026
Merged

OpenApi fixes#42
b4l merged 4 commits intomainfrom
openapi-fixes

Conversation

@ChristianBeilschmidt
Copy link
Copy Markdown
Contributor

@ChristianBeilschmidt ChristianBeilschmidt commented Feb 25, 2026

  • I agree to follow the project's code of conduct.
  • I added an entry to the project's change log file if knowledge of this change could be valuable to users.
    • Usually called CHANGES.md or CHANGELOG.md
    • Prefix changelog entries for breaking changes with "BREAKING: "

Fixes:

  • missing params of /jobs in OpenAPI
  • /jobs limit was always at least 100

Refactor:

  • Results now also reflects that the output could be binary

@ChristianBeilschmidt ChristianBeilschmidt marked this pull request as ready for review February 25, 2026 16:21
Copy link
Copy Markdown
Member

@b4l b4l left a comment

Choose a reason for hiding this comment

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

Thanks!

results: HashMap<String, InlineOrRefData>,
},
#[schema(value_type = String, format = Binary)]
Binary(PhantomData<Vec<u8>>),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this wrapped in 'PhantomData'?

Copy link
Copy Markdown
Contributor Author

@ChristianBeilschmidt ChristianBeilschmidt Feb 26, 2026

Choose a reason for hiding this comment

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

The Results type is more or less used for the API specs. The logic for serializing binary data cannot be behind a serde enum variant. As such, we indicate a type and do the rest with #[schema].

Having an actual Vec<u8> would result in utoipa to incorrectly say it is a list of int or something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Weird, I would expect value_type to be here for that exactly. Maybe this is a shortcoming of utoipa. Maybe a comment would be reasonable here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, cf. juhaku/utoipa#1146

@b4l b4l merged commit 322ea99 into main Feb 27, 2026
2 checks passed
@b4l b4l deleted the openapi-fixes branch February 27, 2026 08:41
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.

2 participants