Skip to content

openapi-generator 6.2.1 generates "import java.util.String" when specifying operation parameters #371

@m0wlheld

Description

@m0wlheld

Running Maven Plugin scs-multiapi:6.2.1:openapi-generation with Java 17 and the OpenAPI document below, the generated Java code imports "java.util.String" and does therefore not compile.

package com.example.api;

import java.util.String;
import java.util.Optional;

openapi.yml:

info:
  description: Description
  title: Title
  version: 1.0.0
openapi: 3.0.3
paths:
  '/path':
    get:
      description: >-
        Path Description
      operationId: doGetPath
      parameters:
        - in: query
          name: queryParam
          schema:
            type: string
      responses:
        "200":
          content:
            text/plain:
              schema:
                type: string
          description: Response Description
      summary: Path Summary
      tags: []


servers:
  - url: http://localhost:8080

pom.xml:

        <plugin>
          <groupId>com.sngular</groupId>
          <artifactId>scs-multiapi-maven-plugin</artifactId>
          <version>6.2.1</version>
          <executions>
            <execution>
              <id>openapi</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>openapi-generation</goal>
              </goals>
              <configuration>
                <specFiles>
                  <specFile>
                    <filePath>${project.basedir}/openapi.yml</filePath>
                    <apiPackage>com.example.api</apiPackage>
                    <modelPackage>com.example.api.model</modelPackage>
                  </specFile>
                </specFiles>
                <springBootVersion>3</springBootVersion>
              </configuration>
            </execution>
          </executions>
        </plugin>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions