Skip to content

Extract inferred_early_responses into free function to avoid monomorphization#293

Merged
jplatte merged 1 commit intotamasfe:mainfrom
kieled:fix/json-monomorphization
Mar 18, 2026
Merged

Extract inferred_early_responses into free function to avoid monomorphization#293
jplatte merged 1 commit intotamasfe:mainfrom
kieled:fix/json-monomorphization

Conversation

@kieled
Copy link
Contributor

@kieled kieled commented Mar 18, 2026

Follow-up to #287 per review feedback.

Summary

  • Extract inferred_early_responses logic from impl<T> OperationInput for axum::Json<T> into a free function inferred_early_responses_json() to avoid unnecessary monomorphization per T.
  • Add inferred_early_responses to JsonDeserializer<T> via the same free function.

Test Plan

  • cargo test -p aide --all-features --lib

…hization

Follow-up to tamasfe#287: the method doesn't depend on T, so delegating to a
free function avoids redundant codegen per concrete type. Also adds
inferred_early_responses to JsonDeserializer via the same function.
@kieled kieled force-pushed the fix/json-monomorphization branch from 3722733 to 0f2959e Compare March 18, 2026 10:35
Copy link
Collaborator

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@jplatte jplatte merged commit fb3941d into tamasfe:main Mar 18, 2026
2 checks passed
@kieled kieled deleted the fix/json-monomorphization branch March 18, 2026 12:30
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