Clone Tools
  • last updated a few minutes ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
CAMEL-12893: OpenAPI REST DSL generator basePat...

...h handling

Now `basePath` from the OpenAPI specification is considered and added

as a part of the REST DSL definition.

  1. … 8 more files in changeset.
Move stuff around to isolate o.a.c.util from o.a.c and o.a.c.support from o.a.c.impl

# Conflicts:

# camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpointProcessor.java

  1. … 2744 more files in changeset.
CAMEL-12841: camel-restdsl-swagger:generate - Special case for Spring Boot with servlet component to generate CamelRestController support class to allow using root context-path and spring boot health check/actuators at the same time.

  1. … 9 more files in changeset.
CAMEL-12841: camel-restdsl-swagger:generate - Add restConfiguration with common defaults

  1. … 2 more files in changeset.
CAMEL-12841: camel-restdsl-swagger:generate - Add restConfiguration with common defaults

  1. … 5 more files in changeset.
CAMEL-12841: camel-restdsl-swagger:generate - Add restConfiguration with common defaults

  1. … 9 more files in changeset.
CAMEL-12805: camel-restdsl-swagger-plugin doesn't convert integer default value to string

  1. … 4 more files in changeset.
CAMEL-12805: camel-restdsl-swagger-plugin doesn't convert integer default value to string

  1. … 4 more files in changeset.
CAMEL-12805: camel-restdsl-swagger-plugin doesn't convert integer default value to string

  1. … 4 more files in changeset.
CAMEL-12283: camel-restdsl-swagger-plugin - Allow to filter operations

    • -0
    • +45
    ./java/org/apache/camel/generator/swagger/OperationFilter.java
  1. … 8 more files in changeset.
CAMEL-12266: Maven plugin for restdsl can now generate xml.

  1. … 4 more files in changeset.
CAMEL-12266: Maven plugin for restdsl can now generate xml.

  1. … 2 more files in changeset.
CAMEL-12266: Maven plugin for restdsl can now generate xml.

  1. … 9 more files in changeset.
CAMEL-11175 REST DSL Swagger generator default ...

...generated class/package names

This refines default class name and package name generation.

  1. … 1 more file in changeset.
CAMEL-11163 Add @Generated annotation in REST D...

...SL Swagger generated code

This makes the `date` annotation member of `@Generated` annotation

optional and its generation turned off by default.

  1. … 2 more files in changeset.
CAMEL-11163 Add @Generated annotation in REST D...

SL Swagger generated code

Adds the `@Generated` annotation to the generated source code of

`RouteBuilder` implementations. This way IDEs and source code analysis

tools know that the code was generated.

  1. … 3 more files in changeset.
CAMEL-11006 Auto generate REST DSL for Camel fr...

...om Swagger2.0/OAI specification

Refactored `directRouteGenerator` to `destinationGenerator` in remaining

places. Refactored `Function<Operation, String>` to

`DestinationGenerator` makes for nicer interface.

CAMEL-11006 Auto generate REST DSL for Camel fr...

...om Swagger2.0/OAI specification

Refactored `directRouteGenerator` to `destinationGenerator` and made

`RestDslDefinitionGenerator` public -- otherwise it could not be used.

  1. … 1 more file in changeset.
CAMEL-11006 Auto generate REST DSL for Camel fr...

...om Swagger2.0/OAI specification

This is initial work on REST DSL code|object generation from Swagger

specification.

Entry point to the implementation is RestDslGenerator::to...(...)

methods. Several options are provided for generating source files:

- for code generation in Maven plugin ones accepting Path or Appendable

should be suitable

- for generation in Annotation Processing ones accepting Filer are more

appropriate

- and for generation of the object graph in runtime the one accepting

CamelContext is provided

Both the source code and object graph implementation depend on a

CodeEmitter implementation: one relying on reflection

(RestDefinitionEmitter) is used to generate the object graph, and the

one generating the source code for the RouteBuilder::configure method

body using the javapoet library (MethodBodySourceCodeEmitter).

CodeEmitter is driven by two visitor pattern implementations one

for processing path elements of the specification (RestDslPathGenerator)

and one for processing operation elements of he specification

(RestDslOperationGenerator). Both can be further adapted to support more

of the Swagger specification. I believe they map the currently used /

relevant parts of the Swagger specification covered by REST DSL.

Example of usage:

RestDslGenerator.toPath(swagger)

.withClassName("MyRestRoute")

.withPackageName("com.example")

.withIndent("\t")

.generate(Paths.get("src", "generated"));

    • -0
    • +25
    ./java/org/apache/camel/generator/swagger/CodeEmitter.java
    • -0
    • +40
    ./java/org/apache/camel/generator/swagger/FilerGenerator.java
    • -0
    • +122
    ./java/org/apache/camel/generator/swagger/OperationVisitor.java
    • -0
    • +39
    ./java/org/apache/camel/generator/swagger/PathGenerator.java
    • -0
    • +43
    ./java/org/apache/camel/generator/swagger/PathVisitor.java
    • -0
    • +86
    ./java/org/apache/camel/generator/swagger/RestDslGenerator.java
  1. … 9 more files in changeset.