This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit c7124889e3a4b82a8c7a16e44c2aa8c94310d02b Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 15:09:26 2026 +0100 CAMEL-23832: camel-rest - improve the component and option descriptions This commit rewrites the component description of rest-api, 4 component and 15 endpoint options and 6 headers of rest, and 1 component and 3 endpoint options of rest-api. The apiDoc texts named Swagger and JSON only; the document is OpenAPI, JSON or YAML, from a file, a URL or the classpath. The routeId text said it names the route; it only goes to the rest registry. consumes and produces now say that the producer sets them as the Accept and Content-Type headers. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-rest is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../apache/camel/catalog/components/rest-api.json | 10 +- .../org/apache/camel/catalog/components/rest.json | 50 ++--- .../camel/catalog/docs/rest-api-component.adoc | 2 +- .../org/apache/camel/component/rest/rest-api.json | 10 +- .../org/apache/camel/component/rest/rest.json | 50 ++--- .../src/main/docs/rest-api-component.adoc | 2 +- .../camel/component/rest/RestApiComponent.java | 11 +- .../camel/component/rest/RestApiEndpoint.java | 28 ++- .../apache/camel/component/rest/RestComponent.java | 38 ++-- .../apache/camel/component/rest/RestConstants.java | 28 ++- .../apache/camel/component/rest/RestEndpoint.java | 140 +++++++------- .../component/ComponentsBuilderFactory.java | 4 +- .../dsl/RestApiComponentBuilderFactory.java | 18 +- .../dsl/RestEndpointComponentBuilderFactory.java | 32 ++-- .../builder/endpoint/StaticEndpointBuilders.java | 46 +++-- .../dsl/RestApiEndpointBuilderFactory.java | 41 ++-- .../endpoint/dsl/RestEndpointBuilderFactory.java | 211 ++++++++++++++------- tasks/component-descriptions.md | 2 +- 18 files changed, 415 insertions(+), 308 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json index 5ced6266a076..305092e71158 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json @@ -3,7 +3,7 @@ "kind": "component", "name": "rest-api", "title": "REST API", - "description": "Expose OpenAPI Specification of the REST services defined using Camel REST DSL.", + "description": "Expose the OpenAPI document of the REST services that are defined with the Rest DSL.", "deprecated": false, "firstVersion": "2.16.0", "label": "core,rest", @@ -25,7 +25,7 @@ }, "componentProperties": { "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] - "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel componen [...] + "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that serves the API documents, such as platform-http, servlet or jetty. The consumerComponentName option of an endpoint replaces it. If neither is set, the component of t [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "bodyTypes": { @@ -33,9 +33,9 @@ "consumerReply": { "carriers": [ "null", "text", "bytes", "stream" ], "dependsOn": [ "consumerComponentName" ], "description": "The API document the route of the REST DSL sets: the OpenAPI document as bytes, JSON unless the path ends with .yaml or the Accept header asks for YAML" } }, "properties": { - "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base path" }, - "apiComponentName": { "index": 1, "kind": "parameter", "displayName": "Api Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for generating the API of the REST services, such as openapi." }, - "consumerComponentName": { "index": 2, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that inte [...] + "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The path that serves the API document, such as api-doc. The Rest DSL sets it from the apiContextPath of the rest configuration. The document is JSON, or YAML when the path ends with .yaml or the Accept header asks for YAML." }, + "apiComponentName": { "index": 1, "kind": "parameter", "displayName": "Api Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the module that creates the API document, such as openapi (camel-openapi-java). If not set, the apiComponent of the rest configuration is used, or else openapi. A single RestApiProcessorFactory in the regist [...] + "consumerComponentName": { "index": 2, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that serves the API document, such as platform-http, servlet or jetty. If not set, the component of the rest configuration is used. If that is not set either, the consumer takes [...] "bridgeErrorHandler": { "index": 3, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] "exceptionHandler": { "index": 4, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By def [...] "exchangePattern": { "index": 5, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest.json index e8649738a019..d58e4f64583a 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest.json @@ -27,21 +27,21 @@ }, "componentProperties": { "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] - "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component th [...] - "apiDoc": { "index": 2, "kind": "property", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The swagger api doc resource to use. The resource is loaded from classpath by default and must be in JSON format." }, - "host": { "index": 3, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Host and port of HTTP service to use (override host in swagger schema)" }, + "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that runs the REST services, such as platform-http, servlet or jetty. The consumerComponentName option of an endpoint replaces it. If neither is set, the component of the [...] + "apiDoc": { "index": 2, "kind": "property", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The location of the OpenAPI document (JSON or YAML) of the REST service to call: a file, an http or https URL, or a classpath resource. The apiDoc option of an endpoint replaces it. If neither is set, the producerApiDoc of the rest c [...] + "host": { "index": 3, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The scheme, host and port of the REST service to call, with an optional base path, such as http:\/\/myserver:8080\/foo. The host option of an endpoint replaces it. If neither is set, the host and port of the rest configuration are used." }, "lazyStartProducer": { "index": 4, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "producerComponentName": { "index": 5, "kind": "property", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the producer REST transport, such as http, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that integra [...] + "producerComponentName": { "index": 5, "kind": "property", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that sends the HTTP requests, such as http or vertx-http. The producerComponentName option of an endpoint replaces it. If neither is set, the producerComponent of the res [...] "autowiredEnabled": { "index": 6, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] "headerFilterStrategy": { "index": 7, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." } }, "headers": { - "CamelRestHttpQuery": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The query parameters for the rest call to be used", "constantName": "org.apache.camel.component.rest.RestConstants#REST_HTTP_QUERY" }, - "CamelRestHttpUri": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The http uri for the rest call to be used", "constantName": "org.apache.camel.component.rest.RestConstants#REST_HTTP_URI" }, - "CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The method should be in upper case", "constantName": "org.apache.camel.component.rest.RestConstants#HTTP_METHOD" }, - "Content-Type": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The media type such as: 'text\/xml', or 'application\/json' this REST service returns.", "constantName": "org.apache.camel.component.rest.RestConstants#CONTENT_TYPE" }, - "Accept": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The media type such as: 'text\/xml', or 'application\/json' this REST service accepts.", "constantName": "org.apache.camel.component.rest.RestConstants#ACCEPT" }, - "CamelHttpResponseCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The http response code", "constantName": "org.apache.camel.component.rest.RestConstants#HTTP_RESPONSE_CODE" } + "CamelRestHttpQuery": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The query string of the request. The producer sets it from the queryParameters option, with the {name} values filled in. The HTTP producer uses it in place of the query of its endpoint.", "constantName": "org.apache.camel.component.rest.RestConstants#REST_HT [...] + "CamelRestHttpUri": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The URI of the request, with the path parameters filled in. The producer sets it when it fills a path parameter from a header or a variable, and then removes the CamelHttpPath header. The HTTP producer uses it in place of the URI of its endpoint.", "constantNa [...] + "CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The HTTP method of the request, in upper case. The producer sets it from the method of the endpoint, and replaces any value that the message has.", "constantName": "org.apache.camel.component.rest.RestConstants#HTTP_METHOD" }, + "Content-Type": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The media type of the request body. The producer sets it to the produces option when the message has no Content-Type header. With binding, the producer reads it to choose between JSON and XML.", "constantName": "org.apache.camel.component.rest.R [...] + "Accept": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The media types that the response may have. The producer sets it to the consumes option when the message has no Accept header.", "constantName": "org.apache.camel.component.rest.RestConstants#ACCEPT" }, + "CamelHttpResponseCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The HTTP status code of the response, which the HTTP producer sets. With binding, the producer does not read a response with a code of 300 or more into outType, unless skipBindingOnErrorCode of the rest configuration is false.", "const [...] }, "bodyTypes": { "consumerOut": { "carriers": [ "stream", "bytes", "null", "map", "file" ], "dependsOn": [ "consumerComponentName" ], "byOption": [ { "option": "bindingMode", "value": "json", "carriers": [ "map", "list", "pojo" ] } ], "description": "The request body as the HTTP consumer gives it (platform-http by default). With bindingMode json, the object of inType, or a Map or a List without inType" }, @@ -50,24 +50,24 @@ "producerOut": { "carriers": [ "bytes", "stream", "null" ], "dependsOn": [ "producerComponentName", "outType" ], "description": "The response body as the HTTP producer gives it; with bindingMode json and outType, an object of outType" } }, "properties": { - "method": { "index": 0, "kind": "path", "displayName": "Method", "group": "common", "label": "common", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "get", "post", "put", "delete", "patch", "head", "trace", "connect", "options" ], "deprecated": false, "autowired": false, "secret": false, "description": "HTTP method to use." }, - "path": { "index": 1, "kind": "path", "displayName": "Path", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base path, can use * as path suffix to support wildcard HTTP route matching." }, - "uriTemplate": { "index": 2, "kind": "path", "displayName": "Uri Template", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The uri template" }, - "consumes": { "index": 3, "kind": "parameter", "displayName": "Consumes", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Media type such as: 'text\/xml', or 'application\/json' this REST service accepts. By default we accept all kinds of types." }, - "inType": { "index": 4, "kind": "parameter", "displayName": "In Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To declare the incoming POJO binding type as a FQN class name" }, - "outType": { "index": 5, "kind": "parameter", "displayName": "Out Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To declare the outgoing POJO binding type as a FQN class name" }, - "produces": { "index": 6, "kind": "parameter", "displayName": "Produces", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Media type such as: 'text\/xml', or 'application\/json' this REST service returns." }, - "routeId": { "index": 7, "kind": "parameter", "displayName": "Route Id", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of the route this REST services creates" }, - "consumerComponentName": { "index": 8, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component t [...] - "description": { "index": 9, "kind": "parameter", "displayName": "Description", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Human description to document this REST service" }, + "method": { "index": 0, "kind": "path", "displayName": "Method", "group": "common", "label": "common", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "get", "post", "put", "delete", "patch", "head", "trace", "connect", "options" ], "deprecated": false, "autowired": false, "secret": false, "description": "The HTTP method of the REST service. The consumer answers requests with this method, and the producer sends the request with it." }, + "path": { "index": 1, "kind": "path", "displayName": "Path", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base path of the REST service, such as users. Without uriTemplate, it is the whole path, and it can hold {name} path parameters as in uriTemplate. A consumer can end it with * to match all the paths that start with it." }, + "uriTemplate": { "index": 2, "kind": "path", "displayName": "Uri Template", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The path below the base path, such as {id}, which can hold {name} path parameters. The consumer sets each path parameter of a request as a header. The producer fills each {name} with the header of that name, or else the exchange va [...] + "consumes": { "index": 3, "kind": "parameter", "displayName": "Consumes", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The media types, separated by comma, that this endpoint takes in, such as application\/json. For the consumer, the media types of the request body that the REST service accepts. The producer sets it as the Accept header of the reques [...] + "inType": { "index": 4, "kind": "parameter", "displayName": "In Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name of the request body, with [] appended for an array. The consumer stores it in the rest registry. With xml binding, the producer uses it as the JAXB context of the request body." }, + "outType": { "index": 5, "kind": "parameter", "displayName": "Out Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name of the response body, with [] appended for an array. With a binding mode other than off, the producer reads a JSON or XML response into this class, and without it the producer does not read the response. The consumer st [...] + "produces": { "index": 6, "kind": "parameter", "displayName": "Produces", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The media types, separated by comma, that this endpoint sends, such as application\/json. For the consumer, the media types of the response body that the REST service returns. The producer sets it as the Content-Type header of the re [...] + "routeId": { "index": 7, "kind": "parameter", "displayName": "Route Id", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of the route of this REST service, which the consumer stores in the rest registry to count the requests of the service. The Rest DSL sets it to the id of the route that it creates. This option does not set the id of the route." }, + "consumerComponentName": { "index": 8, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that runs the REST service, such as platform-http, servlet or jetty. If not set, the component of the rest configuration is used. If that is not set either, the consumer [...] + "description": { "index": 9, "kind": "parameter", "displayName": "Description", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A description of this REST service, which the consumer stores in the rest registry. The Rest DSL sets it from the description of the route, the verb or the rest." }, "bridgeErrorHandler": { "index": 10, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] "exceptionHandler": { "index": 11, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By de [...] "exchangePattern": { "index": 12, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, - "apiDoc": { "index": 13, "kind": "parameter", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The openapi api doc resource to use. The resource is loaded from classpath by default and must be in JSON format." }, - "bindingMode": { "index": 14, "kind": "parameter", "displayName": "Binding Mode", "group": "producer", "label": "producer", "required": false, "type": "enum", "javaType": "org.apache.camel.spi.RestConfiguration.RestBindingMode", "enum": [ "auto", "off", "json", "xml", "json_xml" ], "deprecated": false, "autowired": false, "secret": false, "description": "Configures the binding mode for the producer. If set to anything other than 'off' the producer will try to convert the body of the [...] - "host": { "index": 15, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Host and port of HTTP service to use (override host in openapi schema)" }, - "producerComponentName": { "index": 16, "kind": "parameter", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the producer REST transport, such as http, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that integ [...] - "queryParameters": { "index": 17, "kind": "parameter", "displayName": "Query Parameters", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Query parameters for the HTTP service to call. The query parameters can contain multiple parameters separated by ampersand such such as foo=123&bar=456." }, + "apiDoc": { "index": 13, "kind": "parameter", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The location of the OpenAPI document (JSON or YAML) of the REST service to call: a file, an http or https URL, or a classpath resource. When set, the producer needs camel-openapi-java, and fails to start if the document has no oper [...] + "bindingMode": { "index": 14, "kind": "parameter", "displayName": "Binding Mode", "group": "producer", "label": "producer", "required": false, "type": "enum", "javaType": "org.apache.camel.spi.RestConfiguration.RestBindingMode", "enum": [ "auto", "off", "json", "xml", "json_xml" ], "deprecated": false, "autowired": false, "secret": false, "description": "The binding mode of the producer, which replaces the bindingMode of the rest configuration (off by default). With json, xml or json [...] + "host": { "index": 15, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The scheme, host and port of the REST service to call, with an optional base path, such as http:\/\/myserver:8080\/foo. The scheme is http when it is not given. If not set, the host option of the component, or else the host and port of [...] + "producerComponentName": { "index": 16, "kind": "parameter", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that sends the HTTP request, such as http or vertx-http. If not set, the producerComponent of the rest configuration is used. If that is not set either, the producer ta [...] + "queryParameters": { "index": 17, "kind": "parameter", "displayName": "Query Parameters", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The query string of the request, such as foo=123&bar=456. A value {name} is filled with the header or the exchange variable of that name, and a parameter with the value {name?} is left out when neither is set. The [...] "lazyStartProducer": { "index": 18, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-api-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-api-component.adoc index c62311385fb3..cf1762e9e577 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-api-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-api-component.adoc @@ -2,7 +2,7 @@ :doctitle: REST API :shortname: rest-api :artifactid: camel-rest -:description: Expose OpenAPI Specification of the REST services defined using Camel REST DSL. +:description: Expose the OpenAPI document of the REST services that are defined with the Rest DSL. :since: 2.16 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json b/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json index 5ced6266a076..305092e71158 100644 --- a/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json +++ b/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json @@ -3,7 +3,7 @@ "kind": "component", "name": "rest-api", "title": "REST API", - "description": "Expose OpenAPI Specification of the REST services defined using Camel REST DSL.", + "description": "Expose the OpenAPI document of the REST services that are defined with the Rest DSL.", "deprecated": false, "firstVersion": "2.16.0", "label": "core,rest", @@ -25,7 +25,7 @@ }, "componentProperties": { "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] - "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel componen [...] + "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that serves the API documents, such as platform-http, servlet or jetty. The consumerComponentName option of an endpoint replaces it. If neither is set, the component of t [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "bodyTypes": { @@ -33,9 +33,9 @@ "consumerReply": { "carriers": [ "null", "text", "bytes", "stream" ], "dependsOn": [ "consumerComponentName" ], "description": "The API document the route of the REST DSL sets: the OpenAPI document as bytes, JSON unless the path ends with .yaml or the Accept header asks for YAML" } }, "properties": { - "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base path" }, - "apiComponentName": { "index": 1, "kind": "parameter", "displayName": "Api Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for generating the API of the REST services, such as openapi." }, - "consumerComponentName": { "index": 2, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that inte [...] + "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The path that serves the API document, such as api-doc. The Rest DSL sets it from the apiContextPath of the rest configuration. The document is JSON, or YAML when the path ends with .yaml or the Accept header asks for YAML." }, + "apiComponentName": { "index": 1, "kind": "parameter", "displayName": "Api Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the module that creates the API document, such as openapi (camel-openapi-java). If not set, the apiComponent of the rest configuration is used, or else openapi. A single RestApiProcessorFactory in the regist [...] + "consumerComponentName": { "index": 2, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that serves the API document, such as platform-http, servlet or jetty. If not set, the component of the rest configuration is used. If that is not set either, the consumer takes [...] "bridgeErrorHandler": { "index": 3, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] "exceptionHandler": { "index": 4, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By def [...] "exchangePattern": { "index": 5, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." } diff --git a/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest.json b/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest.json index e8649738a019..d58e4f64583a 100644 --- a/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest.json +++ b/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest.json @@ -27,21 +27,21 @@ }, "componentProperties": { "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] - "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component th [...] - "apiDoc": { "index": 2, "kind": "property", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The swagger api doc resource to use. The resource is loaded from classpath by default and must be in JSON format." }, - "host": { "index": 3, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Host and port of HTTP service to use (override host in swagger schema)" }, + "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that runs the REST services, such as platform-http, servlet or jetty. The consumerComponentName option of an endpoint replaces it. If neither is set, the component of the [...] + "apiDoc": { "index": 2, "kind": "property", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The location of the OpenAPI document (JSON or YAML) of the REST service to call: a file, an http or https URL, or a classpath resource. The apiDoc option of an endpoint replaces it. If neither is set, the producerApiDoc of the rest c [...] + "host": { "index": 3, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The scheme, host and port of the REST service to call, with an optional base path, such as http:\/\/myserver:8080\/foo. The host option of an endpoint replaces it. If neither is set, the host and port of the rest configuration are used." }, "lazyStartProducer": { "index": 4, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "producerComponentName": { "index": 5, "kind": "property", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the producer REST transport, such as http, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that integra [...] + "producerComponentName": { "index": 5, "kind": "property", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that sends the HTTP requests, such as http or vertx-http. The producerComponentName option of an endpoint replaces it. If neither is set, the producerComponent of the res [...] "autowiredEnabled": { "index": 6, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] "headerFilterStrategy": { "index": 7, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." } }, "headers": { - "CamelRestHttpQuery": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The query parameters for the rest call to be used", "constantName": "org.apache.camel.component.rest.RestConstants#REST_HTTP_QUERY" }, - "CamelRestHttpUri": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The http uri for the rest call to be used", "constantName": "org.apache.camel.component.rest.RestConstants#REST_HTTP_URI" }, - "CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The method should be in upper case", "constantName": "org.apache.camel.component.rest.RestConstants#HTTP_METHOD" }, - "Content-Type": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The media type such as: 'text\/xml', or 'application\/json' this REST service returns.", "constantName": "org.apache.camel.component.rest.RestConstants#CONTENT_TYPE" }, - "Accept": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The media type such as: 'text\/xml', or 'application\/json' this REST service accepts.", "constantName": "org.apache.camel.component.rest.RestConstants#ACCEPT" }, - "CamelHttpResponseCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The http response code", "constantName": "org.apache.camel.component.rest.RestConstants#HTTP_RESPONSE_CODE" } + "CamelRestHttpQuery": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The query string of the request. The producer sets it from the queryParameters option, with the {name} values filled in. The HTTP producer uses it in place of the query of its endpoint.", "constantName": "org.apache.camel.component.rest.RestConstants#REST_HT [...] + "CamelRestHttpUri": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The URI of the request, with the path parameters filled in. The producer sets it when it fills a path parameter from a header or a variable, and then removes the CamelHttpPath header. The HTTP producer uses it in place of the URI of its endpoint.", "constantNa [...] + "CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The HTTP method of the request, in upper case. The producer sets it from the method of the endpoint, and replaces any value that the message has.", "constantName": "org.apache.camel.component.rest.RestConstants#HTTP_METHOD" }, + "Content-Type": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The media type of the request body. The producer sets it to the produces option when the message has no Content-Type header. With binding, the producer reads it to choose between JSON and XML.", "constantName": "org.apache.camel.component.rest.R [...] + "Accept": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The media types that the response may have. The producer sets it to the consumes option when the message has no Accept header.", "constantName": "org.apache.camel.component.rest.RestConstants#ACCEPT" }, + "CamelHttpResponseCode": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "The HTTP status code of the response, which the HTTP producer sets. With binding, the producer does not read a response with a code of 300 or more into outType, unless skipBindingOnErrorCode of the rest configuration is false.", "const [...] }, "bodyTypes": { "consumerOut": { "carriers": [ "stream", "bytes", "null", "map", "file" ], "dependsOn": [ "consumerComponentName" ], "byOption": [ { "option": "bindingMode", "value": "json", "carriers": [ "map", "list", "pojo" ] } ], "description": "The request body as the HTTP consumer gives it (platform-http by default). With bindingMode json, the object of inType, or a Map or a List without inType" }, @@ -50,24 +50,24 @@ "producerOut": { "carriers": [ "bytes", "stream", "null" ], "dependsOn": [ "producerComponentName", "outType" ], "description": "The response body as the HTTP producer gives it; with bindingMode json and outType, an object of outType" } }, "properties": { - "method": { "index": 0, "kind": "path", "displayName": "Method", "group": "common", "label": "common", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "get", "post", "put", "delete", "patch", "head", "trace", "connect", "options" ], "deprecated": false, "autowired": false, "secret": false, "description": "HTTP method to use." }, - "path": { "index": 1, "kind": "path", "displayName": "Path", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base path, can use * as path suffix to support wildcard HTTP route matching." }, - "uriTemplate": { "index": 2, "kind": "path", "displayName": "Uri Template", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The uri template" }, - "consumes": { "index": 3, "kind": "parameter", "displayName": "Consumes", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Media type such as: 'text\/xml', or 'application\/json' this REST service accepts. By default we accept all kinds of types." }, - "inType": { "index": 4, "kind": "parameter", "displayName": "In Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To declare the incoming POJO binding type as a FQN class name" }, - "outType": { "index": 5, "kind": "parameter", "displayName": "Out Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To declare the outgoing POJO binding type as a FQN class name" }, - "produces": { "index": 6, "kind": "parameter", "displayName": "Produces", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Media type such as: 'text\/xml', or 'application\/json' this REST service returns." }, - "routeId": { "index": 7, "kind": "parameter", "displayName": "Route Id", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of the route this REST services creates" }, - "consumerComponentName": { "index": 8, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component t [...] - "description": { "index": 9, "kind": "parameter", "displayName": "Description", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Human description to document this REST service" }, + "method": { "index": 0, "kind": "path", "displayName": "Method", "group": "common", "label": "common", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "get", "post", "put", "delete", "patch", "head", "trace", "connect", "options" ], "deprecated": false, "autowired": false, "secret": false, "description": "The HTTP method of the REST service. The consumer answers requests with this method, and the producer sends the request with it." }, + "path": { "index": 1, "kind": "path", "displayName": "Path", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The base path of the REST service, such as users. Without uriTemplate, it is the whole path, and it can hold {name} path parameters as in uriTemplate. A consumer can end it with * to match all the paths that start with it." }, + "uriTemplate": { "index": 2, "kind": "path", "displayName": "Uri Template", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The path below the base path, such as {id}, which can hold {name} path parameters. The consumer sets each path parameter of a request as a header. The producer fills each {name} with the header of that name, or else the exchange va [...] + "consumes": { "index": 3, "kind": "parameter", "displayName": "Consumes", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The media types, separated by comma, that this endpoint takes in, such as application\/json. For the consumer, the media types of the request body that the REST service accepts. The producer sets it as the Accept header of the reques [...] + "inType": { "index": 4, "kind": "parameter", "displayName": "In Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name of the request body, with [] appended for an array. The consumer stores it in the rest registry. With xml binding, the producer uses it as the JAXB context of the request body." }, + "outType": { "index": 5, "kind": "parameter", "displayName": "Out Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name of the response body, with [] appended for an array. With a binding mode other than off, the producer reads a JSON or XML response into this class, and without it the producer does not read the response. The consumer st [...] + "produces": { "index": 6, "kind": "parameter", "displayName": "Produces", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The media types, separated by comma, that this endpoint sends, such as application\/json. For the consumer, the media types of the response body that the REST service returns. The producer sets it as the Content-Type header of the re [...] + "routeId": { "index": 7, "kind": "parameter", "displayName": "Route Id", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of the route of this REST service, which the consumer stores in the rest registry to count the requests of the service. The Rest DSL sets it to the id of the route that it creates. This option does not set the id of the route." }, + "consumerComponentName": { "index": 8, "kind": "parameter", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that runs the REST service, such as platform-http, servlet or jetty. If not set, the component of the rest configuration is used. If that is not set either, the consumer [...] + "description": { "index": 9, "kind": "parameter", "displayName": "Description", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A description of this REST service, which the consumer stores in the rest registry. The Rest DSL sets it from the description of the route, the verb or the rest." }, "bridgeErrorHandler": { "index": 10, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] "exceptionHandler": { "index": 11, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By de [...] "exchangePattern": { "index": 12, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, - "apiDoc": { "index": 13, "kind": "parameter", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The openapi api doc resource to use. The resource is loaded from classpath by default and must be in JSON format." }, - "bindingMode": { "index": 14, "kind": "parameter", "displayName": "Binding Mode", "group": "producer", "label": "producer", "required": false, "type": "enum", "javaType": "org.apache.camel.spi.RestConfiguration.RestBindingMode", "enum": [ "auto", "off", "json", "xml", "json_xml" ], "deprecated": false, "autowired": false, "secret": false, "description": "Configures the binding mode for the producer. If set to anything other than 'off' the producer will try to convert the body of the [...] - "host": { "index": 15, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Host and port of HTTP service to use (override host in openapi schema)" }, - "producerComponentName": { "index": 16, "kind": "parameter", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest component to use for the producer REST transport, such as http, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that integ [...] - "queryParameters": { "index": 17, "kind": "parameter", "displayName": "Query Parameters", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Query parameters for the HTTP service to call. The query parameters can contain multiple parameters separated by ampersand such such as foo=123&bar=456." }, + "apiDoc": { "index": 13, "kind": "parameter", "displayName": "Api Doc", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The location of the OpenAPI document (JSON or YAML) of the REST service to call: a file, an http or https URL, or a classpath resource. When set, the producer needs camel-openapi-java, and fails to start if the document has no oper [...] + "bindingMode": { "index": 14, "kind": "parameter", "displayName": "Binding Mode", "group": "producer", "label": "producer", "required": false, "type": "enum", "javaType": "org.apache.camel.spi.RestConfiguration.RestBindingMode", "enum": [ "auto", "off", "json", "xml", "json_xml" ], "deprecated": false, "autowired": false, "secret": false, "description": "The binding mode of the producer, which replaces the bindingMode of the rest configuration (off by default). With json, xml or json [...] + "host": { "index": 15, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The scheme, host and port of the REST service to call, with an optional base path, such as http:\/\/myserver:8080\/foo. The scheme is http when it is not given. If not set, the host option of the component, or else the host and port of [...] + "producerComponentName": { "index": 16, "kind": "parameter", "displayName": "Producer Component Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Camel component that sends the HTTP request, such as http or vertx-http. If not set, the producerComponent of the rest configuration is used. If that is not set either, the producer ta [...] + "queryParameters": { "index": 17, "kind": "parameter", "displayName": "Query Parameters", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The query string of the request, such as foo=123&bar=456. A value {name} is filled with the header or the exchange variable of that name, and a parameter with the value {name?} is left out when neither is set. The [...] "lazyStartProducer": { "index": 18, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] } } diff --git a/components/camel-rest/src/main/docs/rest-api-component.adoc b/components/camel-rest/src/main/docs/rest-api-component.adoc index c62311385fb3..cf1762e9e577 100644 --- a/components/camel-rest/src/main/docs/rest-api-component.adoc +++ b/components/camel-rest/src/main/docs/rest-api-component.adoc @@ -2,7 +2,7 @@ :doctitle: REST API :shortname: rest-api :artifactid: camel-rest -:description: Expose OpenAPI Specification of the REST services defined using Camel REST DSL. +:description: Expose the OpenAPI document of the REST services that are defined with the Rest DSL. :since: 2.16 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiComponent.java b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiComponent.java index a0858de16e53..a806a0b59512 100644 --- a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiComponent.java +++ b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiComponent.java @@ -29,7 +29,10 @@ import org.apache.camel.support.DefaultComponent; @Component("rest-api") public class RestApiComponent extends DefaultComponent { - @Metadata(label = "consumer") + @Metadata(label = "consumer", + description = "The name of the Camel component that serves the API documents, such as platform-http, servlet" + + " or jetty. The consumerComponentName option of an endpoint replaces it. If neither is set," + + " the component of the rest configuration is used.") private String consumerComponentName; public RestApiComponent() { @@ -56,12 +59,6 @@ public class RestApiComponent extends DefaultComponent { return consumerComponentName; } - /** - * The Camel Rest API component to use for the consumer REST transport, such as jetty, servlet, undertow. If no - * component has been explicitly configured, then Camel will lookup if there is a Camel component that integrates - * with the Rest DSL, or if a org.apache.camel.spi.RestApiConsumerFactory is registered in the registry. If either - * one is found, then that is being used. - */ public void setConsumerComponentName(String consumerComponentName) { this.consumerComponentName = consumerComponentName; } diff --git a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java index e60538430d63..0b2ec007a50e 100644 --- a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java +++ b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java @@ -45,7 +45,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Expose OpenAPI Specification of the REST services defined using Camel REST DSL. + * Expose the OpenAPI document of the REST services that are defined with the Rest DSL. */ @UriEndpoint(firstVersion = "2.16.0", scheme = "rest-api", title = "REST API", syntax = "rest-api:path", remote = false, consumerOnly = true, category = { Category.CORE, Category.REST }, lenientProperties = true) @@ -66,12 +66,20 @@ public class RestApiEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(RestApiEndpoint.class); - @UriPath + @UriPath(description = "The path that serves the API document, such as api-doc. The Rest DSL sets it from the" + + " apiContextPath of the rest configuration. The document is JSON, or YAML when the path ends" + + " with .yaml or the Accept header asks for YAML.") @Metadata(required = true) private String path; - @UriParam + @UriParam(description = "The name of the Camel component that serves the API document, such as platform-http, servlet" + + " or jetty. If not set, the component of the rest configuration is used. If that is not set" + + " either, the consumer takes the first component of the CamelContext that is a" + + " RestApiConsumerFactory, then a single RestApiConsumerFactory in the registry, then" + + " platform-http, servlet, jetty, undertow or netty-http, whichever is on the classpath.") private String consumerComponentName; - @UriParam + @UriParam(description = "The name of the module that creates the API document, such as openapi (camel-openapi-java)." + + " If not set, the apiComponent of the rest configuration is used, or else openapi. A single" + + " RestApiProcessorFactory in the registry is used in its place.") private String apiComponentName; private Map<String, Object> parameters; @@ -95,9 +103,6 @@ public class RestApiEndpoint extends DefaultEndpoint { return path; } - /** - * The base path - */ public void setPath(String path) { this.path = path; } @@ -106,12 +111,6 @@ public class RestApiEndpoint extends DefaultEndpoint { return consumerComponentName; } - /** - * The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no - * component has been explicitly configured, then Camel will lookup if there is a Camel component that integrates - * with the Rest DSL, or if a org.apache.camel.spi.RestConsumerFactory is registered in the registry. If either one - * is found, then that is being used. - */ public void setConsumerComponentName(String consumerComponentName) { this.consumerComponentName = consumerComponentName; } @@ -120,9 +119,6 @@ public class RestApiEndpoint extends DefaultEndpoint { return apiComponentName; } - /** - * The Camel Rest API component to use for generating the API of the REST services, such as openapi. - */ public void setApiComponentName(String apiComponentName) { this.apiComponentName = apiComponentName; } diff --git a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestComponent.java b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestComponent.java index f91a0f67a879..2af48f680d7e 100644 --- a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestComponent.java +++ b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestComponent.java @@ -38,13 +38,25 @@ public class RestComponent extends HeaderFilterStrategyComponent { public static final String DEFAULT_REST_CONFIGURATION_ID = "rest-configuration"; - @Metadata(label = "consumer") + @Metadata(label = "consumer", + description = "The name of the Camel component that runs the REST services, such as platform-http, servlet" + + " or jetty. The consumerComponentName option of an endpoint replaces it. If neither is set," + + " the component of the rest configuration is used.") private String consumerComponentName; - @Metadata(label = "producer") + @Metadata(label = "producer", + description = "The name of the Camel component that sends the HTTP requests, such as http or vertx-http. The" + + " producerComponentName option of an endpoint replaces it. If neither is set, the" + + " producerComponent of the rest configuration is used.") private String producerComponentName; - @Metadata(label = "producer") + @Metadata(label = "producer", + description = "The location of the OpenAPI document (JSON or YAML) of the REST service to call: a file, an" + + " http or https URL, or a classpath resource. The apiDoc option of an endpoint replaces it. If" + + " neither is set, the producerApiDoc of the rest configuration is used.") private String apiDoc; - @Metadata(label = "producer") + @Metadata(label = "producer", + description = "The scheme, host and port of the REST service to call, with an optional base path, such as" + + " http://myserver:8080/foo. The host option of an endpoint replaces it. If neither is set, the" + + " host and port of the rest configuration are used.") private String host; public RestComponent() { @@ -157,12 +169,6 @@ public class RestComponent extends HeaderFilterStrategyComponent { return consumerComponentName; } - /** - * The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no - * component has been explicitly configured, then Camel will lookup if there is a Camel component that integrates - * with the Rest DSL, or if a org.apache.camel.spi.RestConsumerFactory is registered in the registry. If either one - * is found, then that is being used. - */ public void setConsumerComponentName(String consumerComponentName) { this.consumerComponentName = consumerComponentName; } @@ -171,12 +177,6 @@ public class RestComponent extends HeaderFilterStrategyComponent { return producerComponentName; } - /** - * The Camel Rest component to use for the producer REST transport, such as http, undertow. If no component has been - * explicitly configured, then Camel will lookup if there is a Camel component that integrates with the Rest DSL, or - * if a org.apache.camel.spi.RestProducerFactory is registered in the registry. If either one is found, then that is - * being used. - */ public void setProducerComponentName(String producerComponentName) { this.producerComponentName = producerComponentName; } @@ -185,9 +185,6 @@ public class RestComponent extends HeaderFilterStrategyComponent { return apiDoc; } - /** - * The swagger api doc resource to use. The resource is loaded from classpath by default and must be in JSON format. - */ public void setApiDoc(String apiDoc) { this.apiDoc = apiDoc; } @@ -196,9 +193,6 @@ public class RestComponent extends HeaderFilterStrategyComponent { return host; } - /** - * Host and port of HTTP service to use (override host in swagger schema) - */ public void setHost(String host) { this.host = host; } diff --git a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestConstants.java b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestConstants.java index 080669a2fff0..8becb7fb7b3f 100644 --- a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestConstants.java +++ b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestConstants.java @@ -21,21 +21,37 @@ import org.apache.camel.spi.Metadata; public final class RestConstants { - @Metadata(label = "producer", description = "The query parameters for the rest call to be used", javaType = "String") + @Metadata(label = "producer", description = "The query string of the request. The producer sets it from the queryParameters" + + " option, with the {name} values filled in. The HTTP producer uses it in" + + " place of the query of its endpoint.", + javaType = "String") public static final String REST_HTTP_QUERY = Exchange.REST_HTTP_QUERY; - @Metadata(label = "producer", description = "The http uri for the rest call to be used", javaType = "String") + @Metadata(label = "producer", description = "The URI of the request, with the path parameters filled in. The producer sets" + + " it when it fills a path parameter from a header or a variable, and then" + + " removes the CamelHttpPath header. The HTTP producer uses it in place of" + + " the URI of its endpoint.", + javaType = "String") public static final String REST_HTTP_URI = Exchange.REST_HTTP_URI; - @Metadata(label = "producer", description = "The method should be in upper case", javaType = "String") + @Metadata(label = "producer", description = "The HTTP method of the request, in upper case. The producer sets it from the" + + " method of the endpoint, and replaces any value that the message has.", + javaType = "String") public static final String HTTP_METHOD = Exchange.HTTP_METHOD; @Metadata(label = "producer", - description = "The media type such as: 'text/xml', or 'application/json' this REST service returns.", + description = "The media type of the request body. The producer sets it to the produces option when" + + " the message has no Content-Type header. With binding, the producer reads it to choose" + + " between JSON and XML.", javaType = "String", important = true) public static final String CONTENT_TYPE = Exchange.CONTENT_TYPE; @Metadata(label = "producer", - description = "The media type such as: 'text/xml', or 'application/json' this REST service accepts.", + description = "The media types that the response may have. The producer sets it to the consumes option" + + " when the message has no Accept header.", javaType = "String") public static final String ACCEPT = "Accept"; - @Metadata(label = "producer", description = "The http response code", javaType = "Integer", important = true) + @Metadata(label = "producer", description = "The HTTP status code of the response, which the HTTP producer sets. With" + + " binding, the producer does not read a response with a code of 300 or more" + + " into outType, unless skipBindingOnErrorCode of the rest configuration is" + + " false.", + javaType = "Integer", important = true) public static final String HTTP_RESPONSE_CODE = Exchange.HTTP_RESPONSE_CODE; private RestConstants() { diff --git a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java index f202b15593a1..0c9a92a967dc 100644 --- a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java +++ b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java @@ -93,37 +93,91 @@ public class RestEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(RestEndpoint.class); - @UriPath(label = "common", enums = "get,post,put,delete,patch,head,trace,connect,options") + @UriPath(label = "common", enums = "get,post,put,delete,patch,head,trace,connect,options", + description = "The HTTP method of the REST service. The consumer answers requests with this method, and the" + + " producer sends the request with it.") @Metadata(required = true) private String method; - @UriPath(label = "common") + @UriPath(label = "common", + description = "The base path of the REST service, such as users. Without uriTemplate, it is the whole path," + + " and it can hold {name} path parameters as in uriTemplate. A consumer can end it with * to" + + " match all the paths that start with it.") @Metadata(required = true) private String path; - @UriPath(label = "common") + @UriPath(label = "common", + description = "The path below the base path, such as {id}, which can hold {name} path parameters. The" + + " consumer sets each path parameter of a request as a header. The producer fills each {name}" + + " with the header of that name, or else the exchange variable of that name.") private String uriTemplate; - @UriParam(label = "common") + @UriParam(label = "common", + description = "The media types, separated by comma, that this endpoint takes in, such as application/json." + + " For the consumer, the media types of the request body that the REST service accepts. The" + + " producer sets it as the Accept header of the request when the message has no Accept" + + " header.") private String consumes; - @UriParam(label = "common") + @UriParam(label = "common", + description = "The media types, separated by comma, that this endpoint sends, such as application/json. For" + + " the consumer, the media types of the response body that the REST service returns. The" + + " producer sets it as the Content-Type header of the request when the message has no" + + " Content-Type header.") private String produces; - @UriParam(label = "common") + @UriParam(label = "common", + description = "The class name of the request body, with [] appended for an array. The consumer stores it in" + + " the rest registry. With xml binding, the producer uses it as the JAXB context of the" + + " request body.") private String inType; - @UriParam(label = "common") + @UriParam(label = "common", + description = "The class name of the response body, with [] appended for an array. With a binding mode other" + + " than off, the producer reads a JSON or XML response into this class, and without it the" + + " producer does not read the response. The consumer stores it in the rest registry.") private String outType; - @UriParam(label = "common") + @UriParam(label = "common", + description = "The id of the route of this REST service, which the consumer stores in the rest registry to" + + " count the requests of the service. The Rest DSL sets it to the id of the route that it" + + " creates. This option does not set the id of the route.") private String routeId; - @UriParam(label = "consumer") + @UriParam(label = "consumer", + description = "A description of this REST service, which the consumer stores in the rest registry. The Rest" + + " DSL sets it from the description of the route, the verb or the rest.") private String description; - @UriParam(label = "producer") + @UriParam(label = "producer", + description = "The location of the OpenAPI document (JSON or YAML) of the REST service to call: a file, an" + + " http or https URL, or a classpath resource. When set, the producer needs camel-openapi-java," + + " and fails to start if the document has no operation for the method and path. If not set, the" + + " apiDoc option of the component, or else the producerApiDoc of the rest configuration, is" + + " used.") private String apiDoc; - @UriParam(label = "producer") + @UriParam(label = "producer", + description = "The scheme, host and port of the REST service to call, with an optional base path, such as" + + " http://myserver:8080/foo. The scheme is http when it is not given. If not set, the host" + + " option of the component, or else the host and port of the rest configuration, is used. The" + + " producer fails to start without a host.") private String host; - @UriParam(label = "producer") + @UriParam(label = "producer", + description = "The query string of the request, such as foo=123&bar=456. A value {name} is filled with the" + + " header or the exchange variable of that name, and a parameter with the value {name?} is" + + " left out when neither is set. The endpoint also adds the parameters of its URI that it" + + " does not know, except the options of the component that producerComponentName names.") private String queryParameters; - @UriParam(label = "producer", enums = "auto,off,json,xml,json_xml") + @UriParam(label = "producer", enums = "auto,off,json,xml,json_xml", + description = "The binding mode of the producer, which replaces the bindingMode of the rest configuration" + + " (off by default). With json, xml or json_xml, the producer writes a POJO body as JSON or" + + " XML, and reads the response into outType. With auto, it chooses from the Content-Type header," + + " and sends or keeps a body that it cannot bind as it is.") private RestConfiguration.RestBindingMode bindingMode; - @UriParam(label = "producer") + @UriParam(label = "producer", + description = "The name of the Camel component that sends the HTTP request, such as http or vertx-http. If" + + " not set, the producerComponent of the rest configuration is used. If that is not set either," + + " the producer takes the first component of the CamelContext that is a RestProducerFactory," + + " then the component of consumerComponentName, then a single RestProducerFactory in the" + + " registry, then http, vertx-http, undertow or netty-http, whichever is on the classpath.") private String producerComponentName; - @UriParam(label = "consumer") + @UriParam(label = "consumer", + description = "The name of the Camel component that runs the REST service, such as platform-http, servlet or" + + " jetty. If not set, the component of the rest configuration is used. If that is not set" + + " either, the consumer takes the first component of the CamelContext that is a" + + " RestConsumerFactory, then platform-http, then a single RestConsumerFactory in the registry," + + " then servlet, jetty, undertow, netty-http or coap, whichever is on the classpath.") private String consumerComponentName; private Map<String, Object> parameters; @@ -151,9 +205,6 @@ public class RestEndpoint extends DefaultEndpoint { return method; } - /** - * HTTP method to use. - */ public void setMethod(String method) { this.method = method; } @@ -162,9 +213,6 @@ public class RestEndpoint extends DefaultEndpoint { return path; } - /** - * The base path, can use * as path suffix to support wildcard HTTP route matching. - */ public void setPath(String path) { this.path = path; } @@ -173,9 +221,6 @@ public class RestEndpoint extends DefaultEndpoint { return uriTemplate; } - /** - * The uri template - */ public void setUriTemplate(String uriTemplate) { this.uriTemplate = uriTemplate; } @@ -184,10 +229,6 @@ public class RestEndpoint extends DefaultEndpoint { return consumes; } - /** - * Media type such as: 'text/xml', or 'application/json' this REST service accepts. By default we accept all kinds - * of types. - */ public void setConsumes(String consumes) { this.consumes = MimeTypeHelper.sanitizeMimeType(consumes); } @@ -196,9 +237,6 @@ public class RestEndpoint extends DefaultEndpoint { return produces; } - /** - * Media type such as: 'text/xml', or 'application/json' this REST service returns. - */ public void setProduces(String produces) { this.produces = MimeTypeHelper.sanitizeMimeType(produces); } @@ -207,12 +245,6 @@ public class RestEndpoint extends DefaultEndpoint { return producerComponentName; } - /** - * The Camel Rest component to use for the producer REST transport, such as http, undertow. If no component has been - * explicitly configured, then Camel will lookup if there is a Camel component that integrates with the Rest DSL, or - * if a org.apache.camel.spi.RestProducerFactory is registered in the registry. If either one is found, then that is - * being used. - */ public void setProducerComponentName(String producerComponentName) { this.producerComponentName = producerComponentName; } @@ -221,12 +253,6 @@ public class RestEndpoint extends DefaultEndpoint { return consumerComponentName; } - /** - * The Camel Rest component to use for the consumer REST transport, such as jetty, servlet, undertow. If no - * component has been explicitly configured, then Camel will lookup if there is a Camel component that integrates - * with the Rest DSL, or if a org.apache.camel.spi.RestConsumerFactory is registered in the registry. If either one - * is found, then that is being used. - */ public void setConsumerComponentName(String consumerComponentName) { this.consumerComponentName = consumerComponentName; } @@ -235,9 +261,6 @@ public class RestEndpoint extends DefaultEndpoint { return inType; } - /** - * To declare the incoming POJO binding type as a FQN class name - */ public void setInType(String inType) { this.inType = inType; } @@ -246,9 +269,6 @@ public class RestEndpoint extends DefaultEndpoint { return outType; } - /** - * To declare the outgoing POJO binding type as a FQN class name - */ public void setOutType(String outType) { this.outType = outType; } @@ -257,9 +277,6 @@ public class RestEndpoint extends DefaultEndpoint { return routeId; } - /** - * Name of the route this REST services creates - */ public void setRouteId(String routeId) { this.routeId = routeId; } @@ -268,9 +285,6 @@ public class RestEndpoint extends DefaultEndpoint { return description; } - /** - * Human description to document this REST service - */ public void setDescription(String description) { this.description = description; } @@ -290,9 +304,6 @@ public class RestEndpoint extends DefaultEndpoint { return apiDoc; } - /** - * The openapi api doc resource to use. The resource is loaded from classpath by default and must be in JSON format. - */ public void setApiDoc(String apiDoc) { this.apiDoc = apiDoc; } @@ -301,9 +312,6 @@ public class RestEndpoint extends DefaultEndpoint { return host; } - /** - * Host and port of HTTP service to use (override host in openapi schema) - */ public void setHost(String host) { this.host = host; } @@ -312,11 +320,6 @@ public class RestEndpoint extends DefaultEndpoint { return queryParameters; } - /** - * Query parameters for the HTTP service to call. - * - * The query parameters can contain multiple parameters separated by ampersand such such as foo=123&bar=456. - */ public void setQueryParameters(String queryParameters) { this.queryParameters = queryParameters; } @@ -325,11 +328,6 @@ public class RestEndpoint extends DefaultEndpoint { return bindingMode; } - /** - * Configures the binding mode for the producer. If set to anything other than 'off' the producer will try to - * convert the body of the incoming message from inType to the json or xml, and the response from json or xml to - * outType. - */ public void setBindingMode(RestConfiguration.RestBindingMode bindingMode) { this.bindingMode = bindingMode; } diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index d6020ca769b5..0f0de23c87d8 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -4498,8 +4498,8 @@ public interface ComponentsBuilderFactory { } /** * REST API (camel-rest) - * Expose OpenAPI Specification of the REST services defined using Camel - * REST DSL. + * Expose the OpenAPI document of the REST services that are defined with + * the Rest DSL. * * Category: core,rest * Since: 2.16 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestApiComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestApiComponentBuilderFactory.java index 0e91915250e1..33df48ea370f 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestApiComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestApiComponentBuilderFactory.java @@ -24,8 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.rest.RestApiComponent; /** - * Expose OpenAPI Specification of the REST services defined using Camel REST - * DSL. + * Expose the OpenAPI document of the REST services that are defined with the + * Rest DSL. * * Generated by camel build tools - do NOT edit this file! */ @@ -34,8 +34,8 @@ public interface RestApiComponentBuilderFactory { /** * REST API (camel-rest) - * Expose OpenAPI Specification of the REST services defined using Camel - * REST DSL. + * Expose the OpenAPI document of the REST services that are defined with + * the Rest DSL. * * Category: core,rest * Since: 2.16 @@ -81,12 +81,10 @@ public interface RestApiComponentBuilderFactory { } /** - * The Camel Rest API component to use for the consumer REST transport, - * such as jetty, servlet, undertow. If no component has been explicitly - * configured, then Camel will lookup if there is a Camel component that - * integrates with the Rest DSL, or if a - * org.apache.camel.spi.RestApiConsumerFactory is registered in the - * registry. If either one is found, then that is being used. + * The name of the Camel component that serves the API documents, such + * as platform-http, servlet or jetty. The consumerComponentName option + * of an endpoint replaces it. If neither is set, the component of the + * rest configuration is used. * * The option is a: <code>java.lang.String</code> type. * diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestEndpointComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestEndpointComponentBuilderFactory.java index 3d7761e157e9..9975c38d364a 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestEndpointComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/RestEndpointComponentBuilderFactory.java @@ -79,12 +79,10 @@ public interface RestEndpointComponentBuilderFactory { } /** - * The Camel Rest component to use for the consumer REST transport, such - * as jetty, servlet, undertow. If no component has been explicitly - * configured, then Camel will lookup if there is a Camel component that - * integrates with the Rest DSL, or if a - * org.apache.camel.spi.RestConsumerFactory is registered in the - * registry. If either one is found, then that is being used. + * The name of the Camel component that runs the REST services, such as + * platform-http, servlet or jetty. The consumerComponentName option of + * an endpoint replaces it. If neither is set, the component of the rest + * configuration is used. * * The option is a: <code>java.lang.String</code> type. * @@ -99,8 +97,10 @@ public interface RestEndpointComponentBuilderFactory { } /** - * The swagger api doc resource to use. The resource is loaded from - * classpath by default and must be in JSON format. + * The location of the OpenAPI document (JSON or YAML) of the REST + * service to call: a file, an http or https URL, or a classpath + * resource. The apiDoc option of an endpoint replaces it. If neither is + * set, the producerApiDoc of the rest configuration is used. * * The option is a: <code>java.lang.String</code> type. * @@ -115,8 +115,10 @@ public interface RestEndpointComponentBuilderFactory { } /** - * Host and port of HTTP service to use (override host in swagger - * schema). + * The scheme, host and port of the REST service to call, with an + * optional base path, such as http://myserver:8080/foo. The host option + * of an endpoint replaces it. If neither is set, the host and port of + * the rest configuration are used. * * The option is a: <code>java.lang.String</code> type. * @@ -156,12 +158,10 @@ public interface RestEndpointComponentBuilderFactory { } /** - * The Camel Rest component to use for the producer REST transport, such - * as http, undertow. If no component has been explicitly configured, - * then Camel will lookup if there is a Camel component that integrates - * with the Rest DSL, or if a org.apache.camel.spi.RestProducerFactory - * is registered in the registry. If either one is found, then that is - * being used. + * The name of the Camel component that sends the HTTP requests, such as + * http or vertx-http. The producerComponentName option of an endpoint + * replaces it. If neither is set, the producerComponent of the rest + * configuration is used. * * The option is a: <code>java.lang.String</code> type. * diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index f0b9342a877f..02bfc42541b8 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -15157,16 +15157,22 @@ public class StaticEndpointBuilders { * Syntax: <code>rest:method:path:uriTemplate</code> * * Path parameter: method (required) - * HTTP method to use. + * The HTTP method of the REST service. The consumer answers requests with + * this method, and the producer sends the request with it. * There are 9 enums and the value can be one of: get, post, put, delete, * patch, head, trace, connect, options * * Path parameter: path (required) - * The base path, can use * as path suffix to support wildcard HTTP - * route matching. + * The base path of the REST service, such as users. Without uriTemplate, it + * is the whole path, and it can hold {name} path parameters as in + * uriTemplate. A consumer can end it with * to match all the paths that + * start with it. * * Path parameter: uriTemplate - * The uri template + * The path below the base path, such as {id}, which can hold {name} path + * parameters. The consumer sets each path parameter of a request as a + * header. The producer fills each {name} with the header of that name, or + * else the exchange variable of that name. * * @param path method:path:uriTemplate * @return the dsl builder @@ -15185,16 +15191,22 @@ public class StaticEndpointBuilders { * Syntax: <code>rest:method:path:uriTemplate</code> * * Path parameter: method (required) - * HTTP method to use. + * The HTTP method of the REST service. The consumer answers requests with + * this method, and the producer sends the request with it. * There are 9 enums and the value can be one of: get, post, put, delete, * patch, head, trace, connect, options * * Path parameter: path (required) - * The base path, can use * as path suffix to support wildcard HTTP - * route matching. + * The base path of the REST service, such as users. Without uriTemplate, it + * is the whole path, and it can hold {name} path parameters as in + * uriTemplate. A consumer can end it with * to match all the paths that + * start with it. * * Path parameter: uriTemplate - * The uri template + * The path below the base path, such as {id}, which can hold {name} path + * parameters. The consumer sets each path parameter of a request as a + * header. The producer fills each {name} with the header of that name, or + * else the exchange variable of that name. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -15206,8 +15218,8 @@ public class StaticEndpointBuilders { } /** * REST API (camel-rest) - * Expose OpenAPI Specification of the REST services defined using Camel - * REST DSL. + * Expose the OpenAPI document of the REST services that are defined with + * the Rest DSL. * * Category: core,rest * Since: 2.16 @@ -15216,7 +15228,10 @@ public class StaticEndpointBuilders { * Syntax: <code>rest-api:path</code> * * Path parameter: path (required) - * The base path + * The path that serves the API document, such as api-doc. The Rest DSL sets + * it from the apiContextPath of the rest configuration. The document is + * JSON, or YAML when the path ends with .yaml or the Accept header asks for + * YAML. * * @param path path * @return the dsl builder @@ -15226,8 +15241,8 @@ public class StaticEndpointBuilders { } /** * REST API (camel-rest) - * Expose OpenAPI Specification of the REST services defined using Camel - * REST DSL. + * Expose the OpenAPI document of the REST services that are defined with + * the Rest DSL. * * Category: core,rest * Since: 2.16 @@ -15236,7 +15251,10 @@ public class StaticEndpointBuilders { * Syntax: <code>rest-api:path</code> * * Path parameter: path (required) - * The base path + * The path that serves the API document, such as api-doc. The Rest DSL sets + * it from the apiContextPath of the rest configuration. The document is + * JSON, or YAML when the path ends with .yaml or the Accept header asks for + * YAML. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java index f95cb9c79aa1..c943701e4739 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java @@ -27,8 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Expose OpenAPI Specification of the REST services defined using Camel REST - * DSL. + * Expose the OpenAPI document of the REST services that are defined with the + * Rest DSL. * * Generated by camel build tools - do NOT edit this file! */ @@ -46,8 +46,10 @@ public interface RestApiEndpointBuilderFactory { } /** - * The Camel Rest API component to use for generating the API of the - * REST services, such as openapi. + * The name of the module that creates the API document, such as openapi + * (camel-openapi-java). If not set, the apiComponent of the rest + * configuration is used, or else openapi. A single + * RestApiProcessorFactory in the registry is used in its place. * * The option is a: <code>java.lang.String</code> type. * @@ -61,12 +63,13 @@ public interface RestApiEndpointBuilderFactory { return this; } /** - * The Camel Rest component to use for the consumer REST transport, such - * as jetty, servlet, undertow. If no component has been explicitly - * configured, then Camel will lookup if there is a Camel component that - * integrates with the Rest DSL, or if a - * org.apache.camel.spi.RestConsumerFactory is registered in the - * registry. If either one is found, then that is being used. + * The name of the Camel component that serves the API document, such as + * platform-http, servlet or jetty. If not set, the component of the + * rest configuration is used. If that is not set either, the consumer + * takes the first component of the CamelContext that is a + * RestApiConsumerFactory, then a single RestApiConsumerFactory in the + * registry, then platform-http, servlet, jetty, undertow or netty-http, + * whichever is on the classpath. * * The option is a: <code>java.lang.String</code> type. * @@ -213,8 +216,8 @@ public interface RestApiEndpointBuilderFactory { public interface RestApiBuilders { /** * REST API (camel-rest) - * Expose OpenAPI Specification of the REST services defined using Camel - * REST DSL. + * Expose the OpenAPI document of the REST services that are defined + * with the Rest DSL. * * Category: core,rest * Since: 2.16 @@ -223,7 +226,10 @@ public interface RestApiEndpointBuilderFactory { * Syntax: <code>rest-api:path</code> * * Path parameter: path (required) - * The base path + * The path that serves the API document, such as api-doc. The Rest DSL + * sets it from the apiContextPath of the rest configuration. The + * document is JSON, or YAML when the path ends with .yaml or the Accept + * header asks for YAML. * * @param path path * @return the dsl builder @@ -233,8 +239,8 @@ public interface RestApiEndpointBuilderFactory { } /** * REST API (camel-rest) - * Expose OpenAPI Specification of the REST services defined using Camel - * REST DSL. + * Expose the OpenAPI document of the REST services that are defined + * with the Rest DSL. * * Category: core,rest * Since: 2.16 @@ -243,7 +249,10 @@ public interface RestApiEndpointBuilderFactory { * Syntax: <code>rest-api:path</code> * * Path parameter: path (required) - * The base path + * The path that serves the API document, such as api-doc. The Rest DSL + * sets it from the apiContextPath of the rest configuration. The + * document is JSON, or YAML when the path ends with .yaml or the Accept + * header asks for YAML. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java index 118718349931..d610a9f8745d 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestEndpointBuilderFactory.java @@ -44,8 +44,11 @@ public interface RestEndpointBuilderFactory { return (AdvancedRestEndpointConsumerBuilder) this; } /** - * Media type such as: 'text/xml', or 'application/json' this REST - * service accepts. By default we accept all kinds of types. + * The media types, separated by comma, that this endpoint takes in, + * such as application/json. For the consumer, the media types of the + * request body that the REST service accepts. The producer sets it as + * the Accept header of the request when the message has no Accept + * header. * * The option is a: <code>java.lang.String</code> type. * @@ -59,7 +62,9 @@ public interface RestEndpointBuilderFactory { return this; } /** - * To declare the incoming POJO binding type as a FQN class name. + * The class name of the request body, with [] appended for an array. + * The consumer stores it in the rest registry. With xml binding, the + * producer uses it as the JAXB context of the request body. * * The option is a: <code>java.lang.String</code> type. * @@ -73,7 +78,10 @@ public interface RestEndpointBuilderFactory { return this; } /** - * To declare the outgoing POJO binding type as a FQN class name. + * The class name of the response body, with [] appended for an array. + * With a binding mode other than off, the producer reads a JSON or XML + * response into this class, and without it the producer does not read + * the response. The consumer stores it in the rest registry. * * The option is a: <code>java.lang.String</code> type. * @@ -87,8 +95,11 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Media type such as: 'text/xml', or 'application/json' this REST - * service returns. + * The media types, separated by comma, that this endpoint sends, such + * as application/json. For the consumer, the media types of the + * response body that the REST service returns. The producer sets it as + * the Content-Type header of the request when the message has no + * Content-Type header. * * The option is a: <code>java.lang.String</code> type. * @@ -102,7 +113,10 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Name of the route this REST services creates. + * The id of the route of this REST service, which the consumer stores + * in the rest registry to count the requests of the service. The Rest + * DSL sets it to the id of the route that it creates. This option does + * not set the id of the route. * * The option is a: <code>java.lang.String</code> type. * @@ -116,12 +130,13 @@ public interface RestEndpointBuilderFactory { return this; } /** - * The Camel Rest component to use for the consumer REST transport, such - * as jetty, servlet, undertow. If no component has been explicitly - * configured, then Camel will lookup if there is a Camel component that - * integrates with the Rest DSL, or if a - * org.apache.camel.spi.RestConsumerFactory is registered in the - * registry. If either one is found, then that is being used. + * The name of the Camel component that runs the REST service, such as + * platform-http, servlet or jetty. If not set, the component of the + * rest configuration is used. If that is not set either, the consumer + * takes the first component of the CamelContext that is a + * RestConsumerFactory, then platform-http, then a single + * RestConsumerFactory in the registry, then servlet, jetty, undertow, + * netty-http or coap, whichever is on the classpath. * * The option is a: <code>java.lang.String</code> type. * @@ -135,7 +150,9 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Human description to document this REST service. + * A description of this REST service, which the consumer stores in the + * rest registry. The Rest DSL sets it from the description of the + * route, the verb or the rest. * * The option is a: <code>java.lang.String</code> type. * @@ -289,8 +306,11 @@ public interface RestEndpointBuilderFactory { } /** - * Media type such as: 'text/xml', or 'application/json' this REST - * service accepts. By default we accept all kinds of types. + * The media types, separated by comma, that this endpoint takes in, + * such as application/json. For the consumer, the media types of the + * request body that the REST service accepts. The producer sets it as + * the Accept header of the request when the message has no Accept + * header. * * The option is a: <code>java.lang.String</code> type. * @@ -304,7 +324,9 @@ public interface RestEndpointBuilderFactory { return this; } /** - * To declare the incoming POJO binding type as a FQN class name. + * The class name of the request body, with [] appended for an array. + * The consumer stores it in the rest registry. With xml binding, the + * producer uses it as the JAXB context of the request body. * * The option is a: <code>java.lang.String</code> type. * @@ -318,7 +340,10 @@ public interface RestEndpointBuilderFactory { return this; } /** - * To declare the outgoing POJO binding type as a FQN class name. + * The class name of the response body, with [] appended for an array. + * With a binding mode other than off, the producer reads a JSON or XML + * response into this class, and without it the producer does not read + * the response. The consumer stores it in the rest registry. * * The option is a: <code>java.lang.String</code> type. * @@ -332,8 +357,11 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Media type such as: 'text/xml', or 'application/json' this REST - * service returns. + * The media types, separated by comma, that this endpoint sends, such + * as application/json. For the consumer, the media types of the + * response body that the REST service returns. The producer sets it as + * the Content-Type header of the request when the message has no + * Content-Type header. * * The option is a: <code>java.lang.String</code> type. * @@ -347,7 +375,10 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Name of the route this REST services creates. + * The id of the route of this REST service, which the consumer stores + * in the rest registry to count the requests of the service. The Rest + * DSL sets it to the id of the route that it creates. This option does + * not set the id of the route. * * The option is a: <code>java.lang.String</code> type. * @@ -361,8 +392,12 @@ public interface RestEndpointBuilderFactory { return this; } /** - * The openapi api doc resource to use. The resource is loaded from - * classpath by default and must be in JSON format. + * The location of the OpenAPI document (JSON or YAML) of the REST + * service to call: a file, an http or https URL, or a classpath + * resource. When set, the producer needs camel-openapi-java, and fails + * to start if the document has no operation for the method and path. If + * not set, the apiDoc option of the component, or else the + * producerApiDoc of the rest configuration, is used. * * The option is a: <code>java.lang.String</code> type. * @@ -376,10 +411,11 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Configures the binding mode for the producer. If set to anything - * other than 'off' the producer will try to convert the body of the - * incoming message from inType to the json or xml, and the response - * from json or xml to outType. + * The binding mode of the producer, which replaces the bindingMode of + * the rest configuration (off by default). With json, xml or json_xml, + * the producer writes a POJO body as JSON or XML, and reads the + * response into outType. With auto, it chooses from the Content-Type + * header, and sends or keeps a body that it cannot bind as it is. * * The option is a: * <code>org.apache.camel.spi.RestConfiguration.RestBindingMode</code> @@ -395,10 +431,11 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Configures the binding mode for the producer. If set to anything - * other than 'off' the producer will try to convert the body of the - * incoming message from inType to the json or xml, and the response - * from json or xml to outType. + * The binding mode of the producer, which replaces the bindingMode of + * the rest configuration (off by default). With json, xml or json_xml, + * the producer writes a POJO body as JSON or XML, and reads the + * response into outType. With auto, it chooses from the Content-Type + * header, and sends or keeps a body that it cannot bind as it is. * * The option will be converted to a * <code>org.apache.camel.spi.RestConfiguration.RestBindingMode</code> @@ -414,8 +451,11 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Host and port of HTTP service to use (override host in openapi - * schema). + * The scheme, host and port of the REST service to call, with an + * optional base path, such as http://myserver:8080/foo. The scheme is + * http when it is not given. If not set, the host option of the + * component, or else the host and port of the rest configuration, is + * used. The producer fails to start without a host. * * The option is a: <code>java.lang.String</code> type. * @@ -429,12 +469,13 @@ public interface RestEndpointBuilderFactory { return this; } /** - * The Camel Rest component to use for the producer REST transport, such - * as http, undertow. If no component has been explicitly configured, - * then Camel will lookup if there is a Camel component that integrates - * with the Rest DSL, or if a org.apache.camel.spi.RestProducerFactory - * is registered in the registry. If either one is found, then that is - * being used. + * The name of the Camel component that sends the HTTP request, such as + * http or vertx-http. If not set, the producerComponent of the rest + * configuration is used. If that is not set either, the producer takes + * the first component of the CamelContext that is a + * RestProducerFactory, then the component of consumerComponentName, + * then a single RestProducerFactory in the registry, then http, + * vertx-http, undertow or netty-http, whichever is on the classpath. * * The option is a: <code>java.lang.String</code> type. * @@ -448,9 +489,12 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Query parameters for the HTTP service to call. The query parameters - * can contain multiple parameters separated by ampersand such such as - * foo=123&bar=456. + * The query string of the request, such as foo=123&bar=456. A value + * {name} is filled with the header or the exchange variable of that + * name, and a parameter with the value {name?} is left out when neither + * is set. The endpoint also adds the parameters of its URI that it does + * not know, except the options of the component that + * producerComponentName names. * * The option is a: <code>java.lang.String</code> type. * @@ -533,8 +577,11 @@ public interface RestEndpointBuilderFactory { } /** - * Media type such as: 'text/xml', or 'application/json' this REST - * service accepts. By default we accept all kinds of types. + * The media types, separated by comma, that this endpoint takes in, + * such as application/json. For the consumer, the media types of the + * request body that the REST service accepts. The producer sets it as + * the Accept header of the request when the message has no Accept + * header. * * The option is a: <code>java.lang.String</code> type. * @@ -548,7 +595,9 @@ public interface RestEndpointBuilderFactory { return this; } /** - * To declare the incoming POJO binding type as a FQN class name. + * The class name of the request body, with [] appended for an array. + * The consumer stores it in the rest registry. With xml binding, the + * producer uses it as the JAXB context of the request body. * * The option is a: <code>java.lang.String</code> type. * @@ -562,7 +611,10 @@ public interface RestEndpointBuilderFactory { return this; } /** - * To declare the outgoing POJO binding type as a FQN class name. + * The class name of the response body, with [] appended for an array. + * With a binding mode other than off, the producer reads a JSON or XML + * response into this class, and without it the producer does not read + * the response. The consumer stores it in the rest registry. * * The option is a: <code>java.lang.String</code> type. * @@ -576,8 +628,11 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Media type such as: 'text/xml', or 'application/json' this REST - * service returns. + * The media types, separated by comma, that this endpoint sends, such + * as application/json. For the consumer, the media types of the + * response body that the REST service returns. The producer sets it as + * the Content-Type header of the request when the message has no + * Content-Type header. * * The option is a: <code>java.lang.String</code> type. * @@ -591,7 +646,10 @@ public interface RestEndpointBuilderFactory { return this; } /** - * Name of the route this REST services creates. + * The id of the route of this REST service, which the consumer stores + * in the rest registry to count the requests of the service. The Rest + * DSL sets it to the id of the route that it creates. This option does + * not set the id of the route. * * The option is a: <code>java.lang.String</code> type. * @@ -644,16 +702,22 @@ public interface RestEndpointBuilderFactory { * Syntax: <code>rest:method:path:uriTemplate</code> * * Path parameter: method (required) - * HTTP method to use. + * The HTTP method of the REST service. The consumer answers requests + * with this method, and the producer sends the request with it. * There are 9 enums and the value can be one of: get, post, put, * delete, patch, head, trace, connect, options * * Path parameter: path (required) - * The base path, can use * as path suffix to support wildcard HTTP - * route matching. + * The base path of the REST service, such as users. Without + * uriTemplate, it is the whole path, and it can hold {name} path + * parameters as in uriTemplate. A consumer can end it with * to match + * all the paths that start with it. * * Path parameter: uriTemplate - * The uri template + * The path below the base path, such as {id}, which can hold {name} + * path parameters. The consumer sets each path parameter of a request + * as a header. The producer fills each {name} with the header of that + * name, or else the exchange variable of that name. * * @param path method:path:uriTemplate * @return the dsl builder @@ -672,16 +736,22 @@ public interface RestEndpointBuilderFactory { * Syntax: <code>rest:method:path:uriTemplate</code> * * Path parameter: method (required) - * HTTP method to use. + * The HTTP method of the REST service. The consumer answers requests + * with this method, and the producer sends the request with it. * There are 9 enums and the value can be one of: get, post, put, * delete, patch, head, trace, connect, options * * Path parameter: path (required) - * The base path, can use * as path suffix to support wildcard HTTP - * route matching. + * The base path of the REST service, such as users. Without + * uriTemplate, it is the whole path, and it can hold {name} path + * parameters as in uriTemplate. A consumer can end it with * to match + * all the paths that start with it. * * Path parameter: uriTemplate - * The uri template + * The path below the base path, such as {id}, which can hold {name} + * path parameters. The consumer sets each path parameter of a request + * as a header. The producer fills each {name} with the header of that + * name, or else the exchange variable of that name. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -704,7 +774,9 @@ public interface RestEndpointBuilderFactory { public static final RestHeaderNameBuilder INSTANCE = new RestHeaderNameBuilder(); /** - * The query parameters for the rest call to be used. + * The query string of the request. The producer sets it from the + * queryParameters option, with the {name} values filled in. The HTTP + * producer uses it in place of the query of its endpoint. * * The option is a: {@code String} type. * @@ -716,7 +788,10 @@ public interface RestEndpointBuilderFactory { return "CamelRestHttpQuery"; } /** - * The http uri for the rest call to be used. + * The URI of the request, with the path parameters filled in. The + * producer sets it when it fills a path parameter from a header or a + * variable, and then removes the CamelHttpPath header. The HTTP + * producer uses it in place of the URI of its endpoint. * * The option is a: {@code String} type. * @@ -728,7 +803,9 @@ public interface RestEndpointBuilderFactory { return "CamelRestHttpUri"; } /** - * The method should be in upper case. + * The HTTP method of the request, in upper case. The producer sets it + * from the method of the endpoint, and replaces any value that the + * message has. * * The option is a: {@code String} type. * @@ -740,8 +817,9 @@ public interface RestEndpointBuilderFactory { return "CamelHttpMethod"; } /** - * The media type such as: 'text/xml', or 'application/json' this REST - * service returns. + * The media type of the request body. The producer sets it to the + * produces option when the message has no Content-Type header. With + * binding, the producer reads it to choose between JSON and XML. * * The option is a: {@code String} type. * @@ -753,8 +831,8 @@ public interface RestEndpointBuilderFactory { return "Content-Type"; } /** - * The media type such as: 'text/xml', or 'application/json' this REST - * service accepts. + * The media types that the response may have. The producer sets it to + * the consumes option when the message has no Accept header. * * The option is a: {@code String} type. * @@ -766,7 +844,10 @@ public interface RestEndpointBuilderFactory { return "Accept"; } /** - * The http response code. + * The HTTP status code of the response, which the HTTP producer sets. + * With binding, the producer does not read a response with a code of + * 300 or more into outType, unless skipBindingOnErrorCode of the rest + * configuration is false. * * The option is a: {@code Integer} type. * diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index db4c0f1618f4..cbecf77c9151 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -317,7 +317,7 @@ or removes its row. | camel-quickfix | quickfix | | | camel-reactive-streams | reactive-streams | | | camel-ref | ref | | -| camel-rest | rest, rest-api | | +| camel-rest | rest, rest-api | yes | | camel-rest-openapi | rest-openapi | | | camel-rest-postman | rest-postman | | | camel-robotframework | robotframework | |
