rmannibucau commented on a change in pull request #17: Always use reusable 
object component
URL: https://github.com/apache/geronimo-openapi/pull/17#discussion_r320046888
 
 

 ##########
 File path: 
geronimo-openapi-impl/src/main/java/org/apache/geronimo/microprofile/openapi/impl/processor/SchemaProcessor.java
 ##########
 @@ -145,45 +146,22 @@ public void fillSchema(
                     fillSchema(components, Object.class, items, null);
                     schema.items(items);
                 } else {
-                    ofNullable(from.getAnnotation(Schema.class)).ifPresent(
-                            s -> sets(components, Schema.class.cast(s), 
schema, null));
+                    Optional<Annotation> annotation = 
ofNullable(from.getAnnotation(Schema.class));
+                    if (annotation.isPresent()) {
+                        //if providedRef is null and the Schema name is not 
Empty, we set it as providedRef
+                        Schema schemaAnnotation = 
Schema.class.cast(annotation.get());
+                        String ref = schemaAnnotation.name().isEmpty() ? null 
: schemaAnnotation.name();
+                        if (providedRef == null) {
+                            providedRef = ref;
 
 Review comment:
   Shouldnt the ref be resolved (toRef methods) before calling sets?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to