Skip to content

Fix x-spring-provide-args handling. Pass arguments to delegates. Use JavaParser.#24071

Open
wilx wants to merge 1 commit into
OpenAPITools:masterfrom
wilx:fix-x-spring-provide-args-with-java-parser
Open

Fix x-spring-provide-args handling. Pass arguments to delegates. Use JavaParser.#24071
wilx wants to merge 1 commit into
OpenAPITools:masterfrom
wilx:fix-x-spring-provide-args-with-java-parser

Conversation

@wilx

@wilx wilx commented Jun 19, 2026

Copy link
Copy Markdown

This fixes #24063. This is an alternative to #24064. This utilizes JavaParser instead of regular expressions to extract the information it needs.


Summary by cubic

Fixes handling of x-spring-provide-args by using JavaParser and wiring provided args through API interfaces, controllers, and delegates across all request mapping modes, including reactive and pageable combinations. Ensures correct imports, signatures, and call sites with proper comma/parameter ordering and forwarding methods in api_interface mode.

  • Bug Fixes

    • Parse x-spring-provide-args with JavaParser (handles annotations and nested generics).
    • Generate API interface, controller, and delegate methods with provided args; strip annotations on delegate parameters.
    • Pass args by name at call sites, including default forwarding in api_interface mode, controller-to-delegate flows, and interface-only setups.
    • Auto-import and simplify fully qualified annotation and generic type names in generated code.
    • Fix comma/ordering when mixing request context, Pageable, and provided args across reactive and non-reactive modes; add tests for interface-only, api_interface, pageable, and controller-to-delegate flows.
  • Dependencies

    • Move com.github.javaparser:javaparser-core to compile scope.

Written for commit b85a6a1. Summary will update on new commits.

Review in cubic

@wilx wilx force-pushed the fix-x-spring-provide-args-with-java-parser branch from 80ccb69 to c3766cd Compare June 19, 2026 18:47

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found and verified against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread modules/openapi-generator/src/main/resources/JavaSpring/api.mustache Outdated
@wing328

wing328 commented Jun 24, 2026

Copy link
Copy Markdown
Member

please resolve the merge conflicts when you've time

@wilx

wilx commented Jun 24, 2026

Copy link
Copy Markdown
Author

please resolve the merge conflicts when you've time

Resolved.

@wilx wilx force-pushed the fix-x-spring-provide-args-with-java-parser branch 2 times, most recently from c75169d to 80f02f7 Compare June 28, 2026 18:05
@wilx wilx marked this pull request as draft June 28, 2026 19:00
@wilx

wilx commented Jun 28, 2026

Copy link
Copy Markdown
Author

I have identified some issues with the patch related to comma handling. I am working on a fix.

@wilx wilx force-pushed the fix-x-spring-provide-args-with-java-parser branch from 80f02f7 to b85a6a1 Compare June 28, 2026 19:33
@wilx wilx marked this pull request as ready for review June 28, 2026 19:33

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 11 files

Re-trigger cubic

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.

[BUG] Spring generator bug with x-spring-provide-args + interfaceOnly=true + delegatePattern=true + requestMappingMode=api_interface

2 participants