Skip to content

Conversation

@joakimnordling
Copy link
Contributor

If a handler function had a modified function signature (like a header was removed from it), the generated OpenAPI spec could still end up having the parameter included due to how the handler was copied and the annotation for the request model was added.

This changes how the handler function is copied and how the annotation for the request model is added so it works correctly in the case when the signature of the handler function has been modified.

Joakim Nordling added 3 commits October 23, 2025 08:07
If a handler function had a modified function signature (like a header was removed from it), the generated OpenAPI spec could still end up having the parameter included due to how the handler was copied and the annotation for the request model was added.

This changes how the handler function is copied and how the annotation for the request model is added so it works correctly in the case when the signature of the handler function has been modified.
This reverts commit df530a4.

If you would call that route, you would get extra arguments that the function can not handle. I.e. if you use the approach of changing the signature, you should rather just remove optional parameters than trying to add more.
Copy link
Contributor

@lietu lietu left a comment

Choose a reason for hiding this comment

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

I don't really comprehend the code but I see there are tests that seem to do sensible things and I assume you know better.

@joakimnordling joakimnordling merged commit a23d0f4 into main Oct 23, 2025
5 checks passed
@joakimnordling joakimnordling deleted the feature/improve-signatures branch October 23, 2025 08:32
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