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

 ##########
 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:
   not required, as sets calls again fillSchema and fillSchema is calling then 
toRef before using the providedRef.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to