Swagger: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body

32 views
Skip to first unread message

Konstantin Chvilyov

unread,
Nov 13, 2018, 3:19:19 PM11/13/18
to Pac4j users mailing list
Hi All!
I use in @Get methods parameters @Pac4JProfile CommonProfile or
@Pac4JProfile Optional<CommonProfile> or 
@Pac4JProfileManager ProfileManager<CommonProfile>

For example:
@GET
@Path("/login/google/info")
@Pac4JSecurity(clients = "Google2Client", authorizers = "isAuthenticated")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value="TEMPORARY for INFORMATION. Google authorization info.", response=CommonProfile.class)
@ApiResponses(value = { @ApiResponse(code=401, message="Authenticate first!"), @ApiResponse(code=500, message="Internal Server Error")})
public Response getLoginGoogleInfo(@PathParam("locale") String locale,
@Pac4JProfile CommonProfile profile) {

The code is close to jax-rs-pac4j examples:  https://github.com/pac4j/jax-rs-pac4j#setup-with-annotations
But when I Execute these requests by swagger-ui 3 I get an error:
TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
And I can't see the request response.
 
Is it possible to avoid this Error in Swagger?


I use swagger-ui-master.3.18.2

I have in pom.xml:


<properties>
<io.swagger.core.v3.version>2.0.4</io.swagger.core.v3.version>
</properties>

<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.5.12</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2</artifactId>
<version>${io.swagger.core.v3.version}</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
<version>${io.swagger.core.v3.version}</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-oauth</artifactId>
<version>${pac4j.version}</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-config</artifactId>
<version>${pac4j.version}</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>jersey225-pac4j</artifactId>
<version>${pac4j.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.10.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>class-model</artifactId>
<version>2.3.0</version>
<scope>provided</scope>
</dependency>
Message has been deleted

Konstantin Chvilyov

unread,
Nov 13, 2018, 3:30:10 PM11/13/18
to Pac4j users mailing list

<pac4j.version>3.0.0</pac4j.version>


Reply all
Reply to author
Forward
0 new messages