OpenAPITools / OpenAPITools/openapi-generator

[REQ] spring generator generate RequestParams objects

Open
#17,383 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I'd like to see a model class generated for request parameters.

https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-controller/ann-methods/modelattrib-method-args.html

probable this should take some options, as it may not be for controllers, basically the option not to add spring mvc annotations. Really I want it so that we don't forget any. In addition generating the static strings for endpoints would still be nice.

openApiGenerate {
    generatorName = "spring"
    library = "spring-boot"
    inputSpec = "$projectDir/src/main/resources/openapi.json".toString()
    outputDir = layout.buildDirectory.dir("generated/sources/openapi").get().toString()
    configOptions.putAll([
        openApiNullable        : "false",
        generateApis           : "false",
        generateSupportingFiles: "false",
        serializationLibrary   : "jackson",
        interfaceOnly          : "true",
        annotationLibrary      : "none",
        documentationProvider  : "none",
    ])

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The request targets the spring generator and its openApiGenerate configuration, with spring-boot selected in the example. Review the generator’s existing model and request-parameter generation paths first; done should include generated RequestParams model classes, an option for controller annotations, and the requested static endpoint strings where supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi, spring, spring-boot
Domain
api, backend, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.