Swagger-codegen: createCustomResponse in OAuth.java is generated with error [JAVA]

Created on 13 Mar 2017  路  2Comments  路  Source: swagger-api/swagger-codegen

Description

Hi,

I'm using swagger-codegen-maven-plugin to generate the sources.
As the sources are generated mine IDE highlights an error in OAuth.java.
The issue is with the following rows:
return OAuthClientResponseFactory.createCustomResponse( body, contentType, feignResponse.status(), responseClass );

Both declarations have more arguments:
public static <T extends OAuthClientResponse> T createCustomResponse(String body, String contentType, int responseCode, Map<String, List<String>> headers, Class<T> clazz) throws OAuthSystemException, OAuthProblemException { OAuthClientResponse resp = (OAuthClientResponse)OAuthUtils.instantiateClassWithParameters(clazz, (Class[])null, (Object[])null); resp.init(body, contentType, responseCode, headers); return resp; }
public static <T extends OAuthClientResponse> T createCustomResponse(InputStream body, String contentType, int responseCode, Map<String, List<String>> headers, Class<T> clazz) throws OAuthSystemException, OAuthProblemException { OAuthClientResponse resp = (OAuthClientResponse)OAuthUtils.instantiateClassWithParameters(clazz, (Class[])null, (Object[])null); if(body == null) { body = new ByteArrayInputStream(new byte[0]); }

Swagger-codegen version

2.2.1

Swagger declaration file content or url

Command line used for generation
        <plugin>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <inputSpec>src/test/resources/swagger/track.yaml</inputSpec>
                        <language>java</language>
                        <configOptions>
                            <sourceFolder>src/test/java/track/service/testSteps</sourceFolder>
                            <library>feign</library>
                        </configOptions>
                    </configuration>
                </execution>
            </executions>
        </plugin>

mvn generate-sources

Steps to reproduce


Just generate the sources.

Related issues

Suggest a Fix

Most helpful comment

I think, as a workaround, you can step the oltu client version down to 1.0.1

All 2 comments

I think, as a workaround, you can step the oltu client version down to 1.0.1

@leventatbjss, thanks for your comment.
You're right the issue was with library version.

Was this page helpful?
0 / 5 - 0 ratings