Hi

Without looking into this, but you could have both projects and then
compare the generated classes if there is some difference. The package
scanner is there to detect clases by annotations / name etc.


On Thu, Sep 19, 2024 at 5:02 PM <med...@volny.cz> wrote:

> Hello community,
>
> i try to use OpenAPI wing bindingPackageScan to map the request to a POJO
>
> my route definition looks like following:
>
>         restConfiguration()
>             .bindingMode(RestBindingMode.json)
>             .bindingPackageScan("cz.bvv.integrationservices.model");
>
>         rest()
>             .openApi()
>             .specification("/openapi/gop/sender/camelGOP-openapi-v1.json")
>             .missingOperation("ignore");
>
> except for the names it is identical with the example on
> https://github.com/apache/camel-spring-boot-examples/blob/main/openapi-contract-first/src/main/java/sample/petstore/PetStoreRoute.java
>
> the definition part in my OpenAPI looks like:
>
>     "/coorder": {
>       "put": {
>         "tags": [
>           "coorder"
>         ],
>         "summary": "Create or modify Coorder",
>         "operationId": "putCoorder",
>         "requestBody": {
>           "description": "Coorder list",
>           "content": {
>             "application/json": {
>               "schema": {
>                 "$ref": "#/components/schemas/Coorder"
>               }
>             }
>           },
>           "required": true
>         }
>         ]
>       }
>     }
>
>
> This is the generator definition in pom.xml
>
>             <plugin>
>                 <groupId>io.swagger.codegen.v3</groupId>
>                 <artifactId>swagger-codegen-maven-plugin</artifactId>
>                 <version>3.0.52</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>generate</goal>
>                         </goals>
>                         <configuration>
>                             <!-- we only want to generate the model
> classes for spring boot -->
>                             <language>spring</language>
>                             <library>spring-boot3</library>
>
> <inputSpec>${project.basedir}/src/main/resources/openapi/gop/sender/camelGOP-openapi-v1.json</inputSpec>
>
> <modelPackage>cz.bvv.integrationservices.model</modelPackage>
>                             <generateApis>false</generateApis>
>
> <generateApiDocumentation>false</generateApiDocumentation>
>
> <generateModelDocumentation>false</generateModelDocumentation>
>                             <generateApiTests>false</generateApiTests>
>                             <generateModelTests>false</generateModelTests>
>
> <generateSupportingFiles>false</generateSupportingFiles>
>                             <generateModels>true</generateModels>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>
> it is also (except for the filename and package) copied from the example.
>
> But if i debug any inbound message it gets mapped to
> java.util.LinkedHashMap instead of my
> cz.bvv.integrationservices.model.Coorder class.
>
> I tried to build and debug the example project but it maps the request
> JSON correctly to Pet class.
>
> Trying both on version 4.8.0
>
> Can anyone suggest what can be the problem?
>
> Regards
>
> Jiri
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to