Repository navigation
Conversation
fallenmi
left a comment
There was a problem hiding this comment.
Either* represents alternatives, but both new macros currently compose every branch as though all branches were active.
For inputs, operation_input calls each branch in sequence. An Either<Query<A>, Query<B>> therefore documents both parameter sets as simultaneous requirements (and overlapping names report DuplicateParameter), while axum-extra actually tries the branches in order and accepts the first successful extractor.
For outputs, concatenating inferred_responses drops valid alternatives when branches use the same status. Either<Json<A>, Json<B>> yields two 200 responses; set_inferred_response keeps the first and reports InferredResponseConflict for the second, so one runtime response schema is omitted.
Please preserve the alternative semantics. For same-status responses, merge the schemas/content (for example with oneOf) instead of dropping a branch. For parameter alternatives, OpenAPI cannot natively express mutually exclusive parameter sets, so either define and document a safe fallback or avoid a generic OperationInput implementation for unsupported combinations. Please add regression tests for distinct/overlapping query fields and same-status output variants.
Reviewed with OpenAI Codex and Anthropic Claude assistance.
No description provided.