-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Endpoint not generated with the right body parameter #192
Comments
I have tagged this in 3.0.2 because I think this is very blocking and we should not release anything without this fix but feel free to move it to 3.0.3 or later if needed. I just don't want it to be forgotten. |
Thank you for the bug report and the investigation. This is of course a big issue for you (and for other users using the same pattern). The release |
Here a standalone spec to reproduce the problem: swagger: "2.0"
info:
version: "2"
title: "Test API"
basePath: "/xx2"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/ping:
post:
tags:
- Messaging
summary: Add a message event to the given message calendar
operationId: addMessageEventToMessageCalendar
parameters:
- in: body
name: new-message-event
required: true
schema:
$ref: "#/definitions/MessageEventCoreWithTimeListEntries"
responses:
200:
description: OK
definitions:
MessageEventCoreWithTimeListEntries:
type: object
description: "Base of a message event with Time List entries"
allOf:
- $ref: "#/definitions/MessageEventCore"
- type: object
required:
- timeListEntries
properties:
timeListEntries:
type: array
items:
$ref: "#/definitions/TimeListEntry"
MessageEventCore:
type: object
properties:
id:
type: integer
message:
type: string
TimeListEntry:
type: object
properties:
p1:
type: string
p2:
type: string The wrong generated code can be seen in: public class MessagingApiControllerImp implements MessagingApiControllerImpInterface {
@Override
public void addMessageEventToMessageCalendar(MessageEventCore body) throws Exception {
//Do your magic!!!
}
} |
@jmini Thanks. I understand. I would provide a PR myself my I didn't play a lot with the core, mostly worked on multiple generators. |
@jmini Will try this today and let you know! |
@jmini Will try in the upcoming days, not sure when. A lot going on right now. Sorry for the delay |
@jmini I confirm that the changes work! Do you need any other confirmation? I could merge this right now if you want. |
Thank you a lot for the test and review. I have merged the change. Please test |
Confirmer fixed in |
I still sae this in 3.4.0 with python generated code: |
@softarts Can you please try the latest snapshot version which has better support for allOf? You can find it in the readme. Also it would be nice if you can share the full (minimal) spec to more easily reproduce the issue? |
just tried 4.0.0 snapshot, it is fixed.@wing328 |
@softarts Thanks for the confirmation. Happy holidays! |
Description
I really don't understand this one.
I have an endpoint declared like this:
The
MessageEventCoreWithTimeListEntries
is declared like this:Strangely, the endpoint is generated like this:
GetMessageEventResponse addMessageEventToMessageCalendar(Long messageCalendarId, MessageEventCore body) throws Exception;
Instead of:
public GetMessageEventResponse addMessageEventToMessageCalendar(Long messageCalendarId, MessageEventCoreWithTimeListEntries newMessageEvent) throws Exception;
Please note that the
MessageEventCoreWithTimeListEntries
model is generated, but not used in the declaration of the endpoint...openapi-generator version
Latest master
Command line used for generation
java -jar openapi-generator-cli.jar generate -i swagger.yaml --generator-name java-play-framework -o generatedServer -DhideGenerationTimestamp=true
Steps to reproduce
Just run the above command
Related issues/PRs
No idea
Suggest a fix/enhancement
No idea!
The text was updated successfully, but these errors were encountered: