This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new d6aa7da CAMEL-12283: camel-restdsl-swagger-plugin - Allow to filter
operations
d6aa7da is described below
commit d6aa7dab8e23ded3f41aff753875a847586fb094
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Feb 21 13:17:51 2018 +0100
CAMEL-12283: camel-restdsl-swagger-plugin - Allow to filter operations
---
.../src/it/simple-xml/pom.xml | 1 +
.../src/main/docs/camel-package-maven-plugin.adoc | 2 +
.../generator/swagger/AbstractGenerateMojo.java | 3 +
.../maven/generator/swagger/GenerateMojo.java | 4 ++
.../maven/generator/swagger/GenerateXmlMojo.java | 10 +--
.../{PathVisitor.java => OperationFilter.java} | 31 +++++----
.../camel/generator/swagger/OperationVisitor.java | 27 +++++---
.../camel/generator/swagger/PathVisitor.java | 6 +-
.../swagger/RestDslDefinitionGenerator.java | 2 +-
.../camel/generator/swagger/RestDslGenerator.java | 21 +++++-
.../swagger/RestDslSourceCodeGenerator.java | 2 +-
.../generator/swagger/RestDslXmlGenerator.java | 5 +-
.../generator/swagger/RestDslGeneratorTest.java | 15 +++++
.../src/test/resources/MyRestRouteFilter.txt | 78 ++++++++++++++++++++++
.../src/test/resources/SwaggerPetstoreXml.txt | 40 +++++------
15 files changed, 192 insertions(+), 55 deletions(-)
diff --git
a/tooling/maven/camel-restdsl-swagger-plugin/src/it/simple-xml/pom.xml
b/tooling/maven/camel-restdsl-swagger-plugin/src/it/simple-xml/pom.xml
index def5610..95307f0 100644
--- a/tooling/maven/camel-restdsl-swagger-plugin/src/it/simple-xml/pom.xml
+++ b/tooling/maven/camel-restdsl-swagger-plugin/src/it/simple-xml/pom.xml
@@ -47,6 +47,7 @@
</goals>
<configuration>
<blueprint>true</blueprint>
+ <filterOperation>find*,deletePet,updatePet</filterOperation>
</configuration>
</execution>
</executions>
diff --git
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/docs/camel-package-maven-plugin.adoc
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/docs/camel-package-maven-plugin.adoc
index 7528863..e0fef24 100644
---
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/docs/camel-package-maven-plugin.adoc
+++
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/docs/camel-package-maven-plugin.adoc
@@ -23,6 +23,7 @@ in the `<configuration>` tag.
|========================================
| Parameter | Default Value | Description
| `skip` | `false` | Set to `true` to skip code generation.
+| `filterOperation` | | Used for including only the operation ids specified.
Multiple ids can be separated by comma. Wildcards can be used, eg `find*` to
include all operations starting with `find`.
| `specificationUri` | `src/spec/swagger.json` | URI of the Swagger
specification, loaded using Swagger's resource loading mechanism, supports
filesystem paths, HTTP and classpath resources, by default
`src/spec/swagger.json` within the project directory
| `className` | from `title` or `RestDslRoute` | Name of the generated class,
taken from the Swagger specification title or set to `RestDslRoute` by default
| `packageName` | from `host` or `rest.dsl.generated` | Name of the package
for the generated class, taken from the Swagger specification host value or
`rest.dsl.generated` by default
@@ -46,6 +47,7 @@ in the `<configuration>` tag.
|========================================
| Parameter | Default Value | Description
| `skip` | `false` | Set to `true` to skip code generation.
+| `filterOperation` | | Used for including only the operation ids specified.
Multiple ids can be separated by comma. Wildcards can be used, eg `find*` to
include all operations starting with `find`.
| `specificationUri` | `src/spec/swagger.json` | URI of the Swagger
specification, loaded using Swagger's resource loading mechanism, supports
filesystem paths, HTTP and classpath resources, by default
`src/spec/swagger.json` within the project directory
| `outputDirectory` | `generated-sources/restdsl-swagger` | Where to place the
generated source file, by default `generated-sources/restdsl-swagger` within
the project directory
| `fileName` | `camel-rest.xml` | The name of the XML file as output.
diff --git
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/AbstractGenerateMojo.java
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/AbstractGenerateMojo.java
index 247b315..63f8754 100644
---
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/AbstractGenerateMojo.java
+++
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/AbstractGenerateMojo.java
@@ -33,6 +33,9 @@ abstract class AbstractGenerateMojo extends AbstractMojo {
@Parameter
String destinationGenerator;
+ @Parameter
+ String filterOperation;
+
@Parameter(defaultValue = "${project}")
MavenProject project;
diff --git
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateMojo.java
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateMojo.java
index 997aca0..3006b57 100644
---
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateMojo.java
+++
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateMojo.java
@@ -65,6 +65,10 @@ public class GenerateMojo extends AbstractGenerateMojo {
final RestDslSourceCodeGenerator<Path> generator =
RestDslGenerator.toPath(swagger);
+ if (ObjectHelper.isNotEmpty(filterOperation)) {
+ generator.withOperationFilter(filterOperation);
+ }
+
if (ObjectHelper.isNotEmpty(className)) {
generator.withClassName(className);
}
diff --git
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateXmlMojo.java
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateXmlMojo.java
index 4910a16..bee62ad 100644
---
a/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateXmlMojo.java
+++
b/tooling/maven/camel-restdsl-swagger-plugin/src/main/java/org/apache/camel/maven/generator/swagger/GenerateXmlMojo.java
@@ -45,7 +45,7 @@ public class GenerateXmlMojo extends AbstractGenerateMojo {
private String fileName;
@Parameter(defaultValue = "false")
- boolean blueprint;
+ private boolean blueprint;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
@@ -64,14 +64,14 @@ public class GenerateXmlMojo extends AbstractGenerateMojo {
final RestDslXmlGenerator generator = RestDslGenerator.toXml(swagger);
- System.out.println(blueprint);
- System.out.println(blueprint);
- System.out.println(blueprint);
-
if (blueprint) {
generator.withBlueprint();
}
+ if (ObjectHelper.isNotEmpty(filterOperation)) {
+ generator.withOperationFilter(filterOperation);
+ }
+
if (ObjectHelper.isNotEmpty(destinationGenerator)) {
final DestinationGenerator destinationGeneratorObject =
createDestinationGenerator();
diff --git
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/PathVisitor.java
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/OperationFilter.java
similarity index 57%
copy from
tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/PathVisitor.java
copy to
tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/OperationFilter.java
index 5bb46bd..73b8c1d 100644
---
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/PathVisitor.java
+++
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/OperationFilter.java
@@ -16,25 +16,30 @@
*/
package org.apache.camel.generator.swagger;
-import io.swagger.models.Path;
+import java.util.Arrays;
-class PathVisitor<T> {
+import org.apache.camel.util.EndpointHelper;
- private final DestinationGenerator destinationGenerator;
+class OperationFilter {
- private final CodeEmitter<T> emitter;
+ // operation names to include separated by comma (wildcards can be used,
eg find*)
+ private String includes;
- PathVisitor(final CodeEmitter<T> emitter, final DestinationGenerator
destinationGenerator) {
- this.emitter = emitter;
- this.destinationGenerator = destinationGenerator;
+ public String getIncludes() {
+ return includes;
+ }
- emitter.emit("rest");
+ public void setIncludes(String includes) {
+ this.includes = includes;
}
- void visit(final String path, final Path definition) {
- final OperationVisitor<T> restDslOperation = new
OperationVisitor<>(emitter, path, destinationGenerator);
+ boolean accept(String name) {
+ boolean match = true;
- definition.getOperationMap().forEach(restDslOperation::visit);
+ if (includes != null) {
+ String[] patterns = includes.split(",");
+ match = Arrays.stream(patterns).anyMatch(pattern ->
EndpointHelper.matchPattern(name, pattern));
+ }
+ return match;
}
-
-}
\ No newline at end of file
+}
diff --git
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/OperationVisitor.java
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/OperationVisitor.java
index d811066..6b5d6f2 100644
---
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/OperationVisitor.java
+++
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/OperationVisitor.java
@@ -36,10 +36,13 @@ class OperationVisitor<T> {
private final CodeEmitter<T> emitter;
+ private final OperationFilter filter;
+
private final String path;
- OperationVisitor(final CodeEmitter<T> emitter, final String path, final
DestinationGenerator destinationGenerator) {
+ OperationVisitor(final CodeEmitter<T> emitter, final OperationFilter
filter, final String path, final DestinationGenerator destinationGenerator) {
this.emitter = emitter;
+ this.filter = filter;
this.path = path;
this.destinationGenerator = destinationGenerator;
}
@@ -103,18 +106,20 @@ class OperationVisitor<T> {
}
void visit(final HttpMethod method, final Operation operation) {
- final String methodName = method.name().toLowerCase();
- emitter.emit(methodName, path);
+ if (filter.accept(operation.getOperationId())) {
+ final String methodName = method.name().toLowerCase();
+ emitter.emit(methodName, path);
- emit("id", operation.getOperationId());
- emit("description", operation.getDescription());
- emit("consumes", operation.getConsumes());
- emit("produces", operation.getProduces());
+ emit("id", operation.getOperationId());
+ emit("description", operation.getDescription());
+ emit("consumes", operation.getConsumes());
+ emit("produces", operation.getProduces());
- operation.getParameters().forEach(parameter -> {
- emit(parameter);
- });
+ operation.getParameters().forEach(parameter -> {
+ emit(parameter);
+ });
- emitter.emit("to",
destinationGenerator.generateDestinationFor(operation));
+ emitter.emit("to",
destinationGenerator.generateDestinationFor(operation));
+ }
}
}
\ No newline at end of file
diff --git
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/PathVisitor.java
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/PathVisitor.java
index 5bb46bd..ce5054b 100644
---
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/PathVisitor.java
+++
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/PathVisitor.java
@@ -23,16 +23,18 @@ class PathVisitor<T> {
private final DestinationGenerator destinationGenerator;
private final CodeEmitter<T> emitter;
+ private final OperationFilter filter;
- PathVisitor(final CodeEmitter<T> emitter, final DestinationGenerator
destinationGenerator) {
+ PathVisitor(final CodeEmitter<T> emitter, OperationFilter filter, final
DestinationGenerator destinationGenerator) {
this.emitter = emitter;
+ this.filter = filter;
this.destinationGenerator = destinationGenerator;
emitter.emit("rest");
}
void visit(final String path, final Path definition) {
- final OperationVisitor<T> restDslOperation = new
OperationVisitor<>(emitter, path, destinationGenerator);
+ final OperationVisitor<T> restDslOperation = new
OperationVisitor<>(emitter, filter, path, destinationGenerator);
definition.getOperationMap().forEach(restDslOperation::visit);
}
diff --git
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslDefinitionGenerator.java
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslDefinitionGenerator.java
index 3cdde1d..1e0c493 100644
---
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslDefinitionGenerator.java
+++
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslDefinitionGenerator.java
@@ -30,7 +30,7 @@ public final class RestDslDefinitionGenerator extends
RestDslGenerator<RestDslDe
public RestsDefinition generate(final CamelContext context) {
final RestDefinitionEmitter emitter = new
RestDefinitionEmitter(context);
- final PathVisitor<RestsDefinition> restDslStatement = new
PathVisitor<>(emitter, destinationGenerator());
+ final PathVisitor<RestsDefinition> restDslStatement = new
PathVisitor<>(emitter, filter, destinationGenerator());
swagger.getPaths().forEach(restDslStatement::visit);
diff --git
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslGenerator.java
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslGenerator.java
index b6d144c..a0c35c2 100644
---
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslGenerator.java
+++
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslGenerator.java
@@ -32,7 +32,8 @@ public abstract class RestDslGenerator<G> {
final Swagger swagger;
- private DestinationGenerator destinationGenerator = new
DirectToOperationId();
+ DestinationGenerator destinationGenerator = new DirectToOperationId();
+ OperationFilter filter = new OperationFilter();
RestDslGenerator(final Swagger swagger) {
this.swagger = notNull(swagger, "swagger");
@@ -52,6 +53,24 @@ public abstract class RestDslGenerator<G> {
return destinationGenerator;
}
+ public G withOperationFilter(OperationFilter filter) {
+ this.filter = filter;
+
+ @SuppressWarnings("unchecked")
+ final G that = (G) this;
+
+ return that;
+ }
+
+ public G withOperationFilter(String include) {
+ this.filter.setIncludes(include);
+
+ @SuppressWarnings("unchecked")
+ final G that = (G) this;
+
+ return that;
+ }
+
public static RestDslSourceCodeGenerator<Appendable> toAppendable(final
Swagger swagger) {
return new AppendableGenerator(swagger);
}
diff --git
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslSourceCodeGenerator.java
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslSourceCodeGenerator.java
index a630b17..93559c6 100644
---
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslSourceCodeGenerator.java
+++
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslSourceCodeGenerator.java
@@ -101,7 +101,7 @@ public abstract class RestDslSourceCodeGenerator<T> extends
RestDslGenerator<Res
final MethodBodySourceCodeEmitter emitter = new
MethodBodySourceCodeEmitter(configure);
- final PathVisitor<MethodSpec> restDslStatement = new
PathVisitor<>(emitter, destinationGenerator());
+ final PathVisitor<MethodSpec> restDslStatement = new
PathVisitor<>(emitter, filter, destinationGenerator());
swagger.getPaths().forEach(restDslStatement::visit);
return emitter.result();
diff --git
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslXmlGenerator.java
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslXmlGenerator.java
index 1b1b944..b9aab84 100644
---
a/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslXmlGenerator.java
+++
b/tooling/swagger-rest-dsl-generator/src/main/java/org/apache/camel/generator/swagger/RestDslXmlGenerator.java
@@ -37,7 +37,7 @@ public class RestDslXmlGenerator extends
RestDslGenerator<RestDslXmlGenerator> {
public String generate(final CamelContext context) throws Exception {
final RestDefinitionEmitter emitter = new
RestDefinitionEmitter(context);
- final PathVisitor<RestsDefinition> restDslStatement = new
PathVisitor<>(emitter, destinationGenerator());
+ final PathVisitor<RestsDefinition> restDslStatement = new
PathVisitor<>(emitter, filter, destinationGenerator());
swagger.getPaths().forEach(restDslStatement::visit);
@@ -46,6 +46,9 @@ public class RestDslXmlGenerator extends
RestDslGenerator<RestDslXmlGenerator> {
if (blueprint) {
xml = xml.replace("http://camel.apache.org/schema/spring",
"http://camel.apache.org/schema/blueprint");
}
+ // remove all customId attributes as we do not want them in the output
+ xml = xml.replaceAll(" customId=\"true\"", "");
+ xml = xml.replaceAll(" customId=\"false\"", "");
return xml;
}
}
diff --git
a/tooling/swagger-rest-dsl-generator/src/test/java/org/apache/camel/generator/swagger/RestDslGeneratorTest.java
b/tooling/swagger-rest-dsl-generator/src/test/java/org/apache/camel/generator/swagger/RestDslGeneratorTest.java
index ba0a553..e7bfa3a 100644
---
a/tooling/swagger-rest-dsl-generator/src/test/java/org/apache/camel/generator/swagger/RestDslGeneratorTest.java
+++
b/tooling/swagger-rest-dsl-generator/src/test/java/org/apache/camel/generator/swagger/RestDslGeneratorTest.java
@@ -74,4 +74,19 @@ public class RestDslGeneratorTest {
assertThat(code.toString()).isEqualTo(expectedContent);
}
+
+ @Test
+ public void shouldGenerateSourceCodeWithFilter() throws IOException,
URISyntaxException {
+ final StringBuilder code = new StringBuilder();
+
+
RestDslGenerator.toAppendable(swagger).withGeneratedTime(generated).withClassName("MyRestRoute")
+
.withPackageName("com.example").withIndent("\t").withSourceCodeTimestamps()
+ .withOperationFilter("find*,deletePet,updatePet")
+ .withDestinationGenerator(o -> "direct:rest-" +
o.getOperationId()).generate(code);
+
+ final URI file =
RestDslGeneratorTest.class.getResource("/MyRestRouteFilter.txt").toURI();
+ final String expectedContent = new
String(Files.readAllBytes(Paths.get(file)), StandardCharsets.UTF_8);
+
+ assertThat(code.toString()).isEqualTo(expectedContent);
+ }
}
diff --git
a/tooling/swagger-rest-dsl-generator/src/test/resources/MyRestRouteFilter.txt
b/tooling/swagger-rest-dsl-generator/src/test/resources/MyRestRouteFilter.txt
new file mode 100644
index 0000000..4f8df4f
--- /dev/null
+++
b/tooling/swagger-rest-dsl-generator/src/test/resources/MyRestRouteFilter.txt
@@ -0,0 +1,78 @@
+package com.example;
+
+import javax.annotation.Generated;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.rest.CollectionFormat;
+import org.apache.camel.model.rest.RestParamType;
+
+/**
+ * Generated from Swagger specification by Camel REST DSL generator.
+ */
+@Generated(
+ value =
"org.apache.camel.generator.swagger.AppendableGenerator",
+ date = "2017-10-17T00:00:00Z"
+)
+public final class MyRestRoute extends RouteBuilder {
+ /**
+ * Defines Apache Camel routes using REST DSL fluent API.
+ */
+ public void configure() {
+ rest()
+ .put("/pet")
+ .id("updatePet")
+ .consumes("application/json,application/xml")
+ .produces("application/xml,application/json")
+ .param()
+ .name("body")
+ .type(RestParamType.body)
+ .required(true)
+ .description("Pet object that needs to
be added to the store")
+ .endParam()
+ .to("direct:rest-updatePet")
+ .get("/pet/findByStatus")
+ .id("findPetsByStatus")
+ .description("Multiple status values can be
provided with comma separated strings")
+ .produces("application/xml,application/json")
+ .param()
+ .name("status")
+ .type(RestParamType.query)
+ .dataType("array")
+
.collectionFormat(CollectionFormat.multi)
+ .arrayType("string")
+ .required(true)
+ .description("Status values that need
to be considered for filter")
+ .endParam()
+ .to("direct:rest-findPetsByStatus")
+ .get("/pet/findByTags")
+ .id("findPetsByTags")
+ .description("Muliple tags can be provided with
comma separated strings. Use tag1, tag2, tag3 for testing.")
+ .produces("application/xml,application/json")
+ .param()
+ .name("tags")
+ .type(RestParamType.query)
+ .dataType("array")
+
.collectionFormat(CollectionFormat.multi)
+ .arrayType("string")
+ .required(true)
+ .description("Tags to filter by")
+ .endParam()
+ .to("direct:rest-findPetsByTags")
+ .delete("/pet/{petId}")
+ .id("deletePet")
+ .produces("application/xml,application/json")
+ .param()
+ .name("api_key")
+ .type(RestParamType.header)
+ .dataType("string")
+ .required(false)
+ .endParam()
+ .param()
+ .name("petId")
+ .type(RestParamType.path)
+ .dataType("integer")
+ .required(true)
+ .description("Pet id to delete")
+ .endParam()
+ .to("direct:rest-deletePet");
+ }
+}
diff --git
a/tooling/swagger-rest-dsl-generator/src/test/resources/SwaggerPetstoreXml.txt
b/tooling/swagger-rest-dsl-generator/src/test/resources/SwaggerPetstoreXml.txt
index e592be7..ba6d103 100644
---
a/tooling/swagger-rest-dsl-generator/src/test/resources/SwaggerPetstoreXml.txt
+++
b/tooling/swagger-rest-dsl-generator/src/test/resources/SwaggerPetstoreXml.txt
@@ -1,96 +1,96 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rests xmlns="http://camel.apache.org/schema/spring">
<rest>
- <put consumes="application/json,application/xml" customId="true"
id="updatePet" produces="application/xml,application/json" uri="/pet">
+ <put consumes="application/json,application/xml" id="updatePet"
produces="application/xml,application/json" uri="/pet">
<param description="Pet object that needs to be added to the
store" name="body" required="true" type="body"/>
<to uri="direct:updatePet"/>
</put>
- <post consumes="application/json,application/xml" customId="true"
id="addPet" produces="application/xml,application/json" uri="/pet">
+ <post consumes="application/json,application/xml" id="addPet"
produces="application/xml,application/json" uri="/pet">
<param description="Pet object that needs to be added to the
store" name="body" required="true" type="body"/>
<to uri="direct:addPet"/>
</post>
- <get customId="true" id="findPetsByStatus"
produces="application/xml,application/json" uri="/pet/findByStatus">
+ <get id="findPetsByStatus" produces="application/xml,application/json"
uri="/pet/findByStatus">
<description>Multiple status values can be provided with comma
separated strings</description>
<param arrayType="string" collectionFormat="multi"
dataType="array" description="Status values that need to be considered for
filter" name="status" required="true" type="query"/>
<to uri="direct:findPetsByStatus"/>
</get>
- <get customId="true" id="findPetsByTags"
produces="application/xml,application/json" uri="/pet/findByTags">
+ <get id="findPetsByTags" produces="application/xml,application/json"
uri="/pet/findByTags">
<description>Muliple tags can be provided with comma separated
strings. Use tag1, tag2, tag3 for testing.</description>
<param arrayType="string" collectionFormat="multi"
dataType="array" description="Tags to filter by" name="tags" required="true"
type="query"/>
<to uri="direct:findPetsByTags"/>
</get>
- <get customId="true" id="getPetById"
produces="application/xml,application/json" uri="/pet/{petId}">
+ <get id="getPetById" produces="application/xml,application/json"
uri="/pet/{petId}">
<description>Returns a single pet</description>
<param dataType="integer" description="ID of pet to return"
name="petId" required="true" type="path"/>
<to uri="direct:getPetById"/>
</get>
- <post consumes="application/x-www-form-urlencoded" customId="true"
id="updatePetWithForm" produces="application/xml,application/json"
uri="/pet/{petId}">
+ <post consumes="application/x-www-form-urlencoded"
id="updatePetWithForm" produces="application/xml,application/json"
uri="/pet/{petId}">
<param dataType="integer" description="ID of pet that needs to be
updated" name="petId" required="true" type="path"/>
<param dataType="string" description="Updated name of the pet"
name="name" required="false" type="formData"/>
<param dataType="string" description="Updated status of the pet"
name="status" required="false" type="formData"/>
<to uri="direct:updatePetWithForm"/>
</post>
- <delete customId="true" id="deletePet"
produces="application/xml,application/json" uri="/pet/{petId}">
+ <delete id="deletePet" produces="application/xml,application/json"
uri="/pet/{petId}">
<param dataType="string" name="api_key" required="false"
type="header"/>
<param dataType="integer" description="Pet id to delete"
name="petId" required="true" type="path"/>
<to uri="direct:deletePet"/>
</delete>
- <post consumes="multipart/form-data" customId="true" id="uploadFile"
produces="application/json" uri="/pet/{petId}/uploadImage">
+ <post consumes="multipart/form-data" id="uploadFile"
produces="application/json" uri="/pet/{petId}/uploadImage">
<param dataType="integer" description="ID of pet to update"
name="petId" required="true" type="path"/>
<param dataType="string" description="Additional data to pass to
server" name="additionalMetadata" required="false" type="formData"/>
<param dataType="file" description="file to upload" name="file"
required="false" type="formData"/>
<to uri="direct:uploadFile"/>
</post>
- <get customId="true" id="getInventory" produces="application/json"
uri="/store/inventory">
+ <get id="getInventory" produces="application/json"
uri="/store/inventory">
<description>Returns a map of status codes to
quantities</description>
<to uri="direct:getInventory"/>
</get>
- <post customId="true" id="placeOrder"
produces="application/xml,application/json" uri="/store/order">
+ <post id="placeOrder" produces="application/xml,application/json"
uri="/store/order">
<param description="order placed for purchasing the pet"
name="body" required="true" type="body"/>
<to uri="direct:placeOrder"/>
</post>
- <get customId="true" id="getOrderById"
produces="application/xml,application/json" uri="/store/order/{orderId}">
+ <get id="getOrderById" produces="application/xml,application/json"
uri="/store/order/{orderId}">
<description>For valid response try integer IDs with value >= 1
and <= 10. Other values will generated exceptions</description>
<param dataType="integer" description="ID of pet that needs to be
fetched" name="orderId" required="true" type="path"/>
<to uri="direct:getOrderById"/>
</get>
- <delete customId="true" id="deleteOrder"
produces="application/xml,application/json" uri="/store/order/{orderId}">
+ <delete id="deleteOrder" produces="application/xml,application/json"
uri="/store/order/{orderId}">
<description>For valid response try integer IDs with positive
integer value. Negative or non-integer values will generate API
errors</description>
<param dataType="integer" description="ID of the order that needs
to be deleted" name="orderId" required="true" type="path"/>
<to uri="direct:deleteOrder"/>
</delete>
- <post customId="true" id="createUser"
produces="application/xml,application/json" uri="/user">
+ <post id="createUser" produces="application/xml,application/json"
uri="/user">
<description>This can only be done by the logged in
user.</description>
<param description="Created user object" name="body"
required="true" type="body"/>
<to uri="direct:createUser"/>
</post>
- <post customId="true" id="createUsersWithArrayInput"
produces="application/xml,application/json" uri="/user/createWithArray">
+ <post id="createUsersWithArrayInput"
produces="application/xml,application/json" uri="/user/createWithArray">
<param description="List of user object" name="body"
required="true" type="body"/>
<to uri="direct:createUsersWithArrayInput"/>
</post>
- <post customId="true" id="createUsersWithListInput"
produces="application/xml,application/json" uri="/user/createWithList">
+ <post id="createUsersWithListInput"
produces="application/xml,application/json" uri="/user/createWithList">
<param description="List of user object" name="body"
required="true" type="body"/>
<to uri="direct:createUsersWithListInput"/>
</post>
- <get customId="true" id="loginUser"
produces="application/xml,application/json" uri="/user/login">
+ <get id="loginUser" produces="application/xml,application/json"
uri="/user/login">
<param dataType="string" description="The user name for login"
name="username" required="true" type="query"/>
<param dataType="string" description="The password for login in
clear text" name="password" required="true" type="query"/>
<to uri="direct:loginUser"/>
</get>
- <get customId="true" id="logoutUser"
produces="application/xml,application/json" uri="/user/logout">
+ <get id="logoutUser" produces="application/xml,application/json"
uri="/user/logout">
<to uri="direct:logoutUser"/>
</get>
- <get customId="true" id="getUserByName"
produces="application/xml,application/json" uri="/user/{username}">
+ <get id="getUserByName" produces="application/xml,application/json"
uri="/user/{username}">
<param dataType="string" description="The name that needs to be
fetched. Use user1 for testing. " name="username" required="true" type="path"/>
<to uri="direct:getUserByName"/>
</get>
- <put customId="true" id="updateUser"
produces="application/xml,application/json" uri="/user/{username}">
+ <put id="updateUser" produces="application/xml,application/json"
uri="/user/{username}">
<description>This can only be done by the logged in
user.</description>
<param dataType="string" description="name that need to be
updated" name="username" required="true" type="path"/>
<param description="Updated user object" name="body"
required="true" type="body"/>
<to uri="direct:updateUser"/>
</put>
- <delete customId="true" id="deleteUser"
produces="application/xml,application/json" uri="/user/{username}">
+ <delete id="deleteUser" produces="application/xml,application/json"
uri="/user/{username}">
<description>This can only be done by the logged in
user.</description>
<param dataType="string" description="The name that needs to be
deleted" name="username" required="true" type="path"/>
<to uri="direct:deleteUser"/>
--
To stop receiving notification emails like this one, please contact
[email protected].