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
The following commit(s) were added to refs/heads/main by this push: new 373e3e5 CAMEL-16934: camel-swagger-java and camel-openapi-java - Removed support for rendering API DOCs from other CamelContext discovered in the same JVM via JMX. 373e3e5 is described below commit 373e3e52d896f5cf48a43f604d58e9b18b5bc6f5 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Oct 21 10:23:15 2021 +0200 CAMEL-16934: camel-swagger-java and camel-openapi-java - Removed support for rendering API DOCs from other CamelContext discovered in the same JVM via JMX. --- .../component/rest/RestApiEndpointUriFactory.java | 4 +--- .../org/apache/camel/component/rest/rest-api.json | 1 - .../apache/camel/component/rest/RestApiEndpoint.java | 20 +------------------- .../java/org/apache/camel/spi/RestConfiguration.java | 4 ++++ .../apache/camel/model/rest/restConfiguration.json | 4 ++-- .../model/rest/RestConfigurationDefinition.java | 2 ++ .../builder/endpoint/StaticEndpointBuilders.java | 8 -------- .../endpoint/dsl/RestApiEndpointBuilderFactory.java | 8 -------- .../META-INF/camel-main-configuration-metadata.json | 4 ++-- .../camel/main/RestConfigurationProperties.java | 2 ++ 10 files changed, 14 insertions(+), 43 deletions(-) diff --git a/components/camel-rest/src/generated/java/org/apache/camel/component/rest/RestApiEndpointUriFactory.java b/components/camel-rest/src/generated/java/org/apache/camel/component/rest/RestApiEndpointUriFactory.java index ad0c4b3..74dfb8e 100644 --- a/components/camel-rest/src/generated/java/org/apache/camel/component/rest/RestApiEndpointUriFactory.java +++ b/components/camel-rest/src/generated/java/org/apache/camel/component/rest/RestApiEndpointUriFactory.java @@ -20,12 +20,11 @@ public class RestApiEndpointUriFactory extends org.apache.camel.support.componen private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(7); + Set<String> props = new HashSet<>(6); props.add("path"); props.add("apiComponentName"); props.add("bridgeErrorHandler"); props.add("consumerComponentName"); - props.add("contextIdPattern"); props.add("exchangePattern"); props.add("exceptionHandler"); PROPERTY_NAMES = Collections.unmodifiableSet(props); @@ -45,7 +44,6 @@ public class RestApiEndpointUriFactory extends org.apache.camel.support.componen Map<String, Object> copy = new HashMap<>(properties); uri = buildPathParameter(syntax, uri, "path", null, true, copy); - uri = buildPathParameter(syntax, uri, "contextIdPattern", null, false, copy); uri = buildQueryParameters(uri, copy, encode); return uri; } diff --git a/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest-api.json b/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest-api.json index 9476ee1..e1fac7c 100644 --- a/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest-api.json +++ b/components/camel-rest/src/generated/resources/org/apache/camel/component/rest/rest-api.json @@ -27,7 +27,6 @@ }, "properties": { "path": { "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The base path" }, - "contextIdPattern": { "kind": "path", "displayName": "Context Id Pattern", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern." }, "apiComponentName": { "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." }, "bridgeErrorHandler": { "kind": "parameter", "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 occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...] "consumerComponentName": { "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 (consumer) the REST transport, such as jetty, servlet, undertow. If no component has been explicit configured, then Camel will lookup if there is a Camel component that integrates with [...] 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 42619e1..59b5231 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 @@ -53,8 +53,6 @@ public class RestApiEndpoint extends DefaultEndpoint { @UriPath @Metadata(required = true) private String path; - @UriPath - private String contextIdPattern; @UriParam private String consumerComponentName; @UriParam @@ -83,18 +81,6 @@ public class RestApiEndpoint extends DefaultEndpoint { this.path = path; } - public String getContextIdPattern() { - return contextIdPattern; - } - - /** - * Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name - * matches the pattern. - */ - public void setContextIdPattern(String contextIdPattern) { - this.contextIdPattern = contextIdPattern; - } - public String getConsumerComponentName() { return consumerComponentName; } @@ -200,11 +186,7 @@ public class RestApiEndpoint extends DefaultEndpoint { path = "/" + path; } - // whether listing of the context id's is enabled or not - boolean contextIdListing = config.isApiContextListing(); - - Processor processor = factory.createApiProcessor(getCamelContext(), path, getContextIdPattern(), contextIdListing, - config, getParameters()); + Processor processor = factory.createApiProcessor(getCamelContext(), path, config, getParameters()); return new RestApiProducer(this, processor); } else { throw new IllegalStateException( diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java b/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java index cd129c3..2b00aba 100644 --- a/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java +++ b/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java @@ -291,6 +291,7 @@ public class RestConfiguration { this.apiContextRouteId = apiContextRouteId; } + @Deprecated public String getApiContextIdPattern() { return apiContextIdPattern; } @@ -305,10 +306,12 @@ public class RestConfiguration { * * @param apiContextIdPattern the pattern */ + @Deprecated public void setApiContextIdPattern(String apiContextIdPattern) { this.apiContextIdPattern = apiContextIdPattern; } + @Deprecated public boolean isApiContextListing() { return apiContextListing; } @@ -317,6 +320,7 @@ public class RestConfiguration { * Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it * allows to discover these contexts, if <tt>false</tt> then only the current CamelContext is in use. */ + @Deprecated public void setApiContextListing(boolean apiContextListing) { this.apiContextListing = apiContextListing; } diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json index cfba549..ed7935e 100644 --- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json +++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/rest/restConfiguration.json @@ -23,8 +23,8 @@ "contextPath": { "kind": "attribute", "displayName": "Context Path", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a leading context-path the REST services will be using. This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path. Or for components such as camel-jetty or camel-netty-http that includes a HTTP server." }, "apiContextPath": { "kind": "attribute", "displayName": "Api Context Path", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a leading API context-path the REST API services will be using. This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path." }, "apiContextRouteId": { "kind": "attribute", "displayName": "Api Context Route Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the route id to use for the route that services the REST API. The route will by default use an auto assigned route id." }, - "apiContextIdPattern": { "kind": "attribute", "displayName": "Api Context Id Pattern", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets an CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern u [...] - "apiContextListing": { "kind": "attribute", "displayName": "Api Context Listing", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use." }, + "apiContextIdPattern": { "kind": "attribute", "displayName": "Api Context Id Pattern", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "description": "Sets an CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern us [...] + "apiContextListing": { "kind": "attribute", "displayName": "Api Context Listing", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use." }, "apiVendorExtension": { "kind": "attribute", "displayName": "Api Vendor Extension", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether vendor extension is enabled in the Rest APIs. If enabled then Camel will include additional information as vendor extension (eg keys starting with x-) such as route ids, class names etc. Not all 3rd party API gateways and tools [...] "hostNameResolver": { "kind": "attribute", "displayName": "Host Name Resolver", "required": false, "type": "enum", "javaType": "org.apache.camel.model.rest.RestHostNameResolver", "enum": [ "all-local-ip", "local-host-name", "local-ip" ], "deprecated": false, "autowired": false, "secret": false, "description": "If no hostname has been explicit configured, then this resolver is used to compute the hostname the REST service will be using." }, "bindingMode": { "kind": "attribute", "displayName": "Binding Mode", "required": false, "type": "enum", "javaType": "org.apache.camel.model.rest.RestBindingMode", "enum": [ "auto", "json", "json-xml", "off", "xml" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "off", "description": "Sets the binding mode to use. The default value is off" }, diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java index 775fe38..b7f3339 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestConfigurationDefinition.java @@ -86,10 +86,12 @@ public class RestConfigurationDefinition { @XmlAttribute @Metadata(label = "consumer") + @Deprecated private String apiContextIdPattern; @XmlAttribute @Metadata(label = "consumer") + @Deprecated private Boolean apiContextListing; @XmlAttribute diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 5620a57..2d90a06 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -12469,10 +12469,6 @@ public class StaticEndpointBuilders { * Path parameter: path (required) * The base path * - * Path parameter: contextIdPattern - * Optional CamelContext id pattern to only allow Rest APIs from rest - * services within CamelContext's which name matches the pattern. - * * @param path path/contextIdPattern * @return the dsl builder */ @@ -12494,10 +12490,6 @@ public class StaticEndpointBuilders { * Path parameter: path (required) * The base path * - * Path parameter: contextIdPattern - * Optional CamelContext id pattern to only allow Rest APIs from rest - * services within CamelContext's which name matches the pattern. - * * @param componentName to use a custom component name for the endpoint * instead of the default name * @param path path/contextIdPattern diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java index ac531b4..77a62cb 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/RestApiEndpointBuilderFactory.java @@ -218,10 +218,6 @@ public interface RestApiEndpointBuilderFactory { * Path parameter: path (required) * The base path * - * Path parameter: contextIdPattern - * Optional CamelContext id pattern to only allow Rest APIs from rest - * services within CamelContext's which name matches the pattern. - * * @param path path/contextIdPattern * @return the dsl builder */ @@ -242,10 +238,6 @@ public interface RestApiEndpointBuilderFactory { * Path parameter: path (required) * The base path * - * Path parameter: contextIdPattern - * Optional CamelContext id pattern to only allow Rest APIs from rest - * services within CamelContext's which name matches the pattern. - * * @param componentName to use a custom component name for the endpoint * instead of the default name * @param path path/contextIdPattern diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json index b41567a..ab4da55 100644 --- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json +++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json @@ -178,8 +178,8 @@ { "name": "camel.resilience4j.waitDurationInOpenState", "description": "Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it switches to half open. Default value is 60 seconds.", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer", "defaultValue": 60 }, { "name": "camel.resilience4j.writableStackTraceEnabled", "description": "Enables writable stack traces. When set to false, Exception.getStackTrace returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls).", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean", "defaultValue": [...] { "name": "camel.rest.apiComponent", "description": "Sets the name of the Camel component to use as the REST API (such as swagger or openapi)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" }, - { "name": "camel.rest.apiContextIdPattern", "description": "Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern uses the rules from org.apache.camel.support.EndpointHelper#matchPattern(String,String)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaT [...] - { "name": "camel.rest.apiContextListing", "description": "Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.rest.apiContextIdPattern", "description": "Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern. The pattern #name# refers to the CamelContext name, to match on the current CamelContext only. For any other value, the pattern uses the rules from org.apache.camel.support.EndpointHelper#matchPattern(String,String)", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaT [...] + { "name": "camel.rest.apiContextListing", "description": "Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it allows to discover these contexts, if false then only the current CamelContext is in use.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "boolean", "javaType": "boolean", "defaultValue": "false", "deprecated": true }, { "name": "camel.rest.apiContextPath", "description": "Sets a leading API context-path the REST API services will be using. This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.rest.apiContextRouteId", "description": "Sets the route id to use for the route that services the REST API. The route will by default use an auto assigned route id.", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.rest.apiHost", "description": "To use a specific hostname for the API documentation (such as swagger or openapi) This can be used to override the generated host with this configured hostname", "sourceType": "org.apache.camel.spi.RestConfiguration", "type": "string", "javaType": "java.lang.String" }, diff --git a/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java index 422d3f2..4773df8 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java @@ -189,6 +189,7 @@ public class RestConfigurationProperties extends RestConfiguration implements Bo * The pattern <tt>#name#</tt> refers to the CamelContext name, to match on the current CamelContext only. For any * other value, the pattern uses the rules from {@link PatternHelper#matchPattern(String, String)} */ + @Deprecated public RestConfigurationProperties withApiContextIdPattern(String apiContextIdPattern) { setApiContextIdPattern(apiContextIdPattern); return this; @@ -198,6 +199,7 @@ public class RestConfigurationProperties extends RestConfiguration implements Bo * Sets whether listing of all available CamelContext's with REST services in the JVM is enabled. If enabled it * allows to discover these contexts, if <tt>false</tt> then only the current CamelContext is in use. */ + @Deprecated public RestConfigurationProperties withApiContextListing(boolean apiContextListing) { setApiContextListing(apiContextListing); return this;