-
Notifications
You must be signed in to change notification settings - Fork 6k
[Java][Spring] Adds missing import for Map - Fixes #7432 #7510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@aykutakin thanks for the PR. Would this result in duplicated import of "java.util.Map" if there are more than 1 response with the type |
I thought I've tested it, but apparently tested it wrong. Thanks for pointing that out again @wing328. When I change the input yaml as in below, as you've foreseen, it generates 2 paths:
/pets:
get:
summary: List all pets
operationId: listPets
tags:
- pets
parameters:
- name: limit
in: query
description: How many items to return at one time (max 100)
required: false
type: integer
format: int32
responses:
"200":
description: A paged array of pets
headers:
x-next:
type: string
description: A link to the next page of responses
schema:
type: object
additionalProperties:
type: array
items:
type: string
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
/pets/{petId}:
get:
summary: Info for a specific pet
operationId: showPetById
tags:
- pets
parameters:
- name: petId
in: path
required: true
description: The id of the pet to retrieve
type: string
responses:
"200":
description: Expected response to a valid request
schema:
type: object
additionalProperties:
type: array
items:
type: string
default:
description: unexpected error
schema:
$ref: '#/definitions/Error' Template file also has hard coded |
Change has been made to import complex type's through |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.@bbdouglas @JFCote @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger
Description of the PR
Java Spring code generator has missing
java.util.Map
import when api return type isMap
.Tested with:
Fixes #7432