Skip to content

Add check for void @ApiOperation/@ApiResponse returntype and fix @ApiResponse response-type #4718

@jfiala

Description

@jfiala
Description

The check for vendorExtensions.x-java-is-response-void implemented for jaxrs-spec in #4717 should be
backported to all Java languages.
Additionally, the currently used class for response is wrong (returnType is at the operation level, but the data type of the CodegenResponse should be used = baseType.

  1. Add check for void at operation level
    @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{returnType}}}.class{{/vendorExtensions.x-java-is-response-void}}...
  1. Change the response-Class to "baseType" and add check for void at @ApiResponse-level:
        @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{/vendorExtensions.x-java-is-response-void}}...

Languages to be updated:

Swagger-codegen version

2.2.2-SNAPSHOT

Related issues

Jaxrs-Spec issue #4509
PR 4717

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