forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#36198 from phillip-kruger/openapi-defaul…
…t-content-type OpenAPI different default content type for pojo return and primitives
- Loading branch information
Showing
8 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...yment/src/test/java/io/quarkus/smallrye/openapi/test/jaxrs/NoDefaultSecurityResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.quarkus.smallrye.openapi.test.jaxrs; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
@Path("/greeting") | ||
public class NoDefaultSecurityResource { | ||
|
||
@GET | ||
@Path("/hello") | ||
public Greeting hello() { | ||
return new Greeting("Hello there"); | ||
} | ||
|
||
@POST | ||
@Path("/hello") | ||
public Greeting hello(Greeting greeting) { | ||
return greeting; | ||
} | ||
|
||
@GET | ||
@Path("/goodbye") | ||
@Produces(MediaType.APPLICATION_XML) | ||
public Greeting byebye() { | ||
return new Greeting("Good Bye !"); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...eployment/src/test/java/io/quarkus/smallrye/openapi/test/jaxrs/NoDefaultSecurityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.quarkus.smallrye.openapi.test.jaxrs; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class NoDefaultSecurityTest { | ||
private static final String OPEN_API_PATH = "/q/openapi"; | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest runner = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(NoDefaultSecurityResource.class, Greeting.class)); | ||
|
||
@Test | ||
public void testOpenApiNoSecurity() { | ||
RestAssured.given().queryParam("format", "JSON") | ||
.when().get(OPEN_API_PATH) | ||
.then() | ||
.body("components.securitySchemes.SecurityScheme.type", Matchers.nullValue()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters