Skip to content

[Java*] Flag for void methods in mustache files #4089

@jfiala

Description

@jfiala
Description
jaxrs-cxf-server:

Currently there is a variable returnType, but it contains "void" for Java methods with no result.
We need a flag to check in the mustache templates if a method is "void" (true/false) to generate the apiServiceImpl and the unit tests accordingly.

apiServiceImpl.mustache:

{{#returnType}}return null;{{/returnType}}

This line should only be generated for non-void methods, but currently its not possible to check for void.

api_test.mustache:
Currently all methods are handled like they return a response:

// {{#returnType}}{{{returnType}}} response =...
Unittests (all Java languages)

The handling of void return types should be changed in all Java unit test templates.

Swagger-codegen version

master

Related issues

extracted from PR #4003

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions