reimer-atb opened a new issue, #8388:
URL: https://github.com/apache/camel-quarkus/issues/8388

   ### Bug description
   
   With an OpenApi spec that contains this:
   ```
   components:
     schemas:
       some_type:
         type: object
         properties:
           bar:
             type: string
           foo_properties:
             $ref: "#/components/schemas/foo_properties"
       foo_properties:
         description: Dictionary mapping a string to any type
         type: object
        #properties:
        #  version:
        #    type: integer
        #    description: dummy property necessary so that code generation 
succeeds
         additionalProperties: true
   ```
   
   the generated code for `FooProperties.java` is missing the import statement 
for `@RegisterForReflection`:
   
   ```
   import java.util.Objects;
   import java.util.Arrays;
   import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
   import com.fasterxml.jackson.annotation.JsonInclude;
   import io.swagger.v3.oas.annotations.media.Schema;
   import java.util.HashMap;
   import java.util.Map;
   /**
    * Dictionary mapping a string to any type
    */
   @Schema(description = "Dictionary mapping a string to any type")
   @jakarta.annotation.Generated(value = 
"org.apache.camel.quarkus.component.rest.openapi.deployment.QuarkusCodegen", 
date = "2026-03-05T15:40:31.376660183+01:00[Europe/Berlin]")
   @JsonInclude(JsonInclude.Include.NON_NULL)
   @RegisterForReflection
   @JsonIgnoreProperties(ignoreUnknown = true)
   
   public class FooProperties extends HashMap<String, Object> {
   ....
   ```
   
   and the code does not compile.
   
   The import statement is added only when I uncomment the `properties` in 
`foo_properties` and add an "unnecessary dummy" property.
   
   ---
   
   Zulip topic: [#camel-quarkus > REST OpenApi: missing import for 
@RegisterForReflection](https://camel.zulipchat.com/#narrow/channel/257302-camel-quarkus/topic/REST.20OpenApi.3A.20missing.20import.20for.20.40RegisterForReflection/with/577693301)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to