Skip to content

feat(aide): implement OperationInput/OperationOutput for axum_extra::either types - #300

Open
kyrias wants to merge 1 commit into
tamasfe:mainfrom
kyrias:axum-extra-either
Open

kyrias wants to merge 1 commit into
tamasfe:mainfrom
kyrias:axum-extra-either

Conversation

@kyrias

@kyrias kyrias commented Aug 13, 2026 •

Copy link
Copy Markdown

No description provided.

@fallenmi fallenmi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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