2

My team is evaluating adopting OpenAPI Generator for our project, and the ability to declaratively keep Spring MVC mappings in sync with the spec is attractive. However, much of Spring MVC's value comes from its ability to automatically resolve request information and provide it as strongly typed method parameters, and in the examples I've seen the generated Java interfaces only reflect the request attributes as directly listed in the spec. For example, userId is a string in a path mapping, and in my controller I want to inject that as a UUID or even a User (with DomainClassConverter). Additionally, I may want access to the HttpSession.

Is there any way (short of rewriting the templates) to customize the method parameters so that I can get the mappings autogenerated but add attributes for my own requirements?

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
  • I would suggest you to open an issue via https://github.com/OpenAPITools/openapi-generator/issues/new to start a discussion if you haven't done so – William Cheng Nov 28 '18 at 16:36
  • @WilliamCheng Based on what I've seen of how the Mustache templates work, supporting the kind of flexibility I'm looking for would require a complete architectural overhaul of the generator pipeline. Is that sort of measure on the table? – chrylis -cautiouslyoptimistic- Nov 28 '18 at 19:38

0 Answers0