Bug Report Checklist
Description
Using the spring-cloud library of the spring generator results in a ClientConfiguration.java file generated and referenced by a Feign-Client API interface that lists unnecessary packages. Without specifying these packages as "compile-time" dependencies the service cannot be compiled. Making the package import definitions conditional this is mitigated.
openapi-generator version
4.2.2. No regression.
OpenAPI declaration file content or url
openapi: "3.0.0"
info:
version: 0.1.0
title: frontend-v1
license:
name: MIT
paths:
/echo:
post:
summary: Echoes back your own words.
requestBody:
description: The sound to echo.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EchoRequest"
responses:
"200":
description: Your echo as requested.
content:
application/json:
schema:
$ref: "#/components/schemas/EchoResponse"
components:
schemas:
EchoRequest:
properties:
sound:
type: string
description: The sound to echo.
required:
- sound
EchoResponse:
properties:
echo:
type: string
description: The actual echo.
required:
- echo
Command line used for generation
java -jar openapi-generator-cli.jar generate -i spec.yaml -g spring --library spring-cloud
Steps to reproduce
- Get the spec
- Run the command line
- Try to compile the generated code with minimal dependencies.
Related issues/PRs
The same seemed to happen in typescript-rxjs generator
#3339
Suggest a fix
Import packages conditionally.
Bug Report Checklist
Description
Using the
spring-cloudlibrary of thespringgenerator results in a ClientConfiguration.java file generated and referenced by a Feign-Client API interface that lists unnecessary packages. Without specifying these packages as "compile-time" dependencies the service cannot be compiled. Making the package import definitions conditional this is mitigated.openapi-generator version
4.2.2. No regression.
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
The same seemed to happen in
typescript-rxjsgenerator#3339
Suggest a fix
Import packages conditionally.