Handling two different request media types with openapi-generator-maven-plugin

57 Views Asked by At

The problem is pretty similar to Handling two different response media types with openapi-generator-maven-plugin

but in my case I have multiple content types in Request body. I would expect generation of two overloaded functions with different parameters, but only one is created with CreateRequest parameter.

Is there way how to do it?

"requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRequest"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "byte"
              }
            }
          },
          "required": true
        }

pom config:

            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>7.3.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>
                                ${project.basedir}/src/main/resources/api/something/swagger.json
                            </inputSpec>
                            <generatorName>kotlin</generatorName>
                            <library>jvm-retrofit2</library>
                            <packageName>com.something.v1</packageName>
                            <output>${project.build.directory}/generated-sources/kotlin</output>
                            <configOptions>
                                <delegatePattern>true</delegatePattern>
                                <enumPropertyNaming>UPPERCASE</enumPropertyNaming>
                                <idea>true</idea>
                                <useCoroutines>true</useCoroutines>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

I would expect two separete functions to be generated.

0

There are 0 best solutions below