Skip to content

jaxrs-cxf-client - Generate error in @ApiResponse when the response class is not specified #7853

@liberoguerra

Description

@liberoguerra
Description

ISSUE:
I use language jaxrs-cxf-client and inside json file there is not specified a response class for HTTP Status code 401.
After generation, the api class contains several errors about @apiresponse. In detail the plugin generates this line in error "response = .class"

API class generated (Java code)

...
	@ApiResponses(value = {
		@ApiResponse(code = 200, message = "OK", response = ResponseBody.class),
		@ApiResponse(code = 401, message = "Unauthorized", response = .class)
	})
...
Swagger-codegen version

2.2.3 and 2.3.1

Swagger declaration file content
...
	"responses":{
		"200":{
			"description":"OK",
			"schema":{
				"$ref":"#/definitions/ResponseBody"
			}
		},
		"401":{
			"description":"Unauthorized"
		}
	}
...
Command line used for generation

I use maven generate goals with this configuration:

<configuration>
	<inputSpec>scr/main/resources/file.json</inputSpec>
	<language>jaxrs-cxf-client</language>
	<configOptions>
		<sourceFolder>codegen</sourceFolder>
		<apiPackage>com.example.rest.api</apiPackage>
		<modelPackage>com.example.rest.model</modelPackage>
		<generateApiTests>false</generateApiTests>
		<generateModelTests>false</generateModelTests>
		<useJaxbAnnotations>true</useJaxbAnnotations>
	
	</configOptions>
</configuration>

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