aldettinger commented on a change in pull request #3060:
URL: https://github.com/apache/camel-quarkus/pull/3060#discussion_r699972046
##########
File path:
integration-tests/openapi-java/src/main/java/org/apache/camel/quarkus/component/openapijava/it/OpenApiRoutes.java
##########
@@ -23,21 +23,127 @@
import javax.ws.rs.core.MediaType;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.rest.CollectionFormat;
+import org.apache.camel.model.rest.RestParamType;
import org.apache.camel.quarkus.component.openapijava.it.model.Fruit;
public class OpenApiRoutes extends RouteBuilder {
@Override
public void configure() throws Exception {
- Set<Fruit> fruits =
Collections.newSetFromMap(Collections.synchronizedMap(new LinkedHashMap<>()));
- fruits.add(new Fruit("Apple", "Winter fruit"));
- fruits.add(new Fruit("Pineapple", "Tropical fruit"));
rest()
.get("/fruits/list")
.id("list")
.produces(MediaType.APPLICATION_JSON)
.route()
- .setBody().constant(fruits)
- .marshal().json();
+ .setBody().constant(getFruits())
+ .marshal().json()
+ .endRest()
+
+ .get("/operation/spec")
+ .param()
+ .type(RestParamType.header)
+ .name("header_number")
+ .dataType("integer")
+ .required(true)
+ .allowableValues("1", "2", "3")
+ .defaultValue("1")
+ .description("Header Param Number")
+ .endParam()
+ .param()
+ .type(RestParamType.query)
+ .name("query_letter")
+ .dataType("string")
+ .required(false)
+ .allowableValues("A", "B", "C")
+ .defaultValue("B")
+ .description("Query Param Letter")
+ .collectionFormat(CollectionFormat.multi)
+ .endParam()
+ .responseMessage()
+ .code(418)
+ .message("I am a teapot")
+ .responseModel(Integer.class)
+ .header("rate")
+ .description("API Rate Limit")
+ .dataType("integer")
+ .endHeader()
+ .endResponseMessage()
+ .responseMessage()
+ .code("error")
+ .message("Response Error")
+ .endResponseMessage()
+ .route()
+ .setBody().constant("GET: /operation/spec")
+ .endRest()
+
+ .get("/security/scopes")
+ .security("OAuth2", "scope1,scope2,scope3")
+ .route()
+ .setBody().constant("GET: /security/scopes")
+ .endRest()
+
+ .get("/security/api/key")
+ .route()
+ .setBody().constant("GET: /security/api/key/header")
+ .endRest()
+ .securityDefinitions()
+ .apiKey("X-API-Key", "The API key")
+ .withHeader("X-API-KEY")
+ .end()
+ .end()
+
+ .get("/security/basic/auth")
+ .route()
+ .setBody().constant("/security/basic/auth")
+ .endRest()
+ .securityDefinitions()
+ .basicAuth("basicAuth", "Basic Authentication")
+ .end()
+
+ .get("/security/bearer/token")
+ .route()
+ .setBody().constant("/security/bearer/token")
+ .endRest()
+ .securityDefinitions()
+ .bearerToken("bearerAuth", "Bearer Token Authentication")
+ .end()
+
+ .get("/security/mutual/tls")
+ .route()
+ .setBody().constant("/security/mutual/tls")
+ .endRest()
+ .securityDefinitions()
+ .mutualTLS("mutualTLS")
+ .end()
+
+ .get("/security/ouath2")
Review comment:
Maybe /security/oauth2 ?
Same for authorizationUrl below ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]