Skip to content
Permalink
Browse files
Fix #3737 to register reflection methods of OpenAPI Schema (#3738)
  • Loading branch information
zhfeng committed Apr 20, 2022
1 parent 9dd2eb3 commit 925cf3ba539680781ae3751f7a307eefcfb5a74e
Showing 2 changed files with 16 additions and 1 deletion.
@@ -96,7 +96,7 @@ void reflectiveClasses(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses

IndexView index = combinedIndex.getIndex();
index.getAllKnownSubclasses(SCHEMA).stream().map(ClassInfo::toString).forEach(
name -> reflectiveClasses.produce(new ReflectiveClassBuildItem(false, false, name)));
name -> reflectiveClasses.produce(new ReflectiveClassBuildItem(true, false, name)));
}

@BuildStep(onlyIf = ExposeOpenApiEnabled.class)
@@ -16,6 +16,8 @@
*/
package org.apache.camel.quarkus.component.openapijava.it.model;

import java.util.List;

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
@@ -24,10 +26,23 @@ public class Fruit {
public String name;
public String description;
public Integer num;
private List<Element> elements;

public Fruit(String name, String description, Integer num) {
this.name = name;
this.description = description;
this.num = num;
}

public List<Element> getElements() {
return elements;
}

public void setElements(List<Element> elements) {
this.elements = elements;
}
}

@RegisterForReflection
class Element {
}

0 comments on commit 925cf3b

Please sign in to comment.