Skip to content

Commit

Permalink
feature: adding OpenAPI support for multiple examples in the REST Lis…
Browse files Browse the repository at this point in the history
…tener.
  • Loading branch information
lorenzo committed Aug 24, 2020
1 parent 85d8387 commit 2e1701b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import com.reedelk.module.descriptor.analyzer.component.ComponentAnalyzerContext;
import com.reedelk.module.descriptor.model.property.ListDescriptor;
import com.reedelk.module.descriptor.model.property.PropertyTypeDescriptor;
import com.reedelk.runtime.api.annotation.*;
import com.reedelk.runtime.api.annotation.ListDisplayProperty;
import com.reedelk.runtime.api.annotation.TabGroup;
import com.reedelk.runtime.api.commons.PlatformTypes;
import io.github.classgraph.ClassRefTypeSignature;
import io.github.classgraph.FieldInfo;
Expand All @@ -25,10 +26,7 @@ public boolean test(String fullyQualifiedClassName, FieldInfo fieldInfo, Compone
@Override
public PropertyTypeDescriptor create(String fullyQualifiedClassName, FieldInfo fieldInfo, ComponentAnalyzerContext context) {
String tabGroup = annotationValueFrom(fieldInfo, TabGroup.class, null);
String dialogTitle = annotationValueFrom(fieldInfo, DialogTitle.class, null);
String listDisplayProperty = annotationValueFrom(fieldInfo, ListDisplayProperty.class, null);
String listInput = annotationValueFrom(fieldInfo, ListInputType.class, ListInputType.ListInput.DEFAULT.name());
String hintBrowseFile = annotationValueFrom(fieldInfo, HintBrowseFile.class, null); // For ListInput.FILE

// We must find out the value type of the List.
// The Value type could be a primitive type or a custom object type.
Expand All @@ -42,10 +40,7 @@ public PropertyTypeDescriptor create(String fullyQualifiedClassName, FieldInfo f
PropertyTypeDescriptor valueType = factory.create(valueTypeFullyQualifiedName, fieldInfo, context);

ListDescriptor descriptor = new ListDescriptor();
descriptor.setListInput(ListInputType.ListInput.valueOf(listInput));
descriptor.setListDisplayProperty(listDisplayProperty);
descriptor.setHintBrowseFile(hintBrowseFile);
descriptor.setDialogTitle(dialogTitle);
descriptor.setValueType(valueType);
descriptor.setTabGroup(tabGroup);
return descriptor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.reedelk.module.descriptor.model.property;

import com.reedelk.runtime.api.annotation.ListInputType;

import java.util.List;

public class ListDescriptor extends CollectionAwareDescriptor {
Expand All @@ -11,7 +9,6 @@ public class ListDescriptor extends CollectionAwareDescriptor {
private PropertyTypeDescriptor valueType;
private String listDisplayProperty;
private String hintBrowseFile;
private ListInputType.ListInput listInput;

@Override
public Class<?> getType() {
Expand All @@ -34,14 +31,6 @@ public void setListDisplayProperty(String listDisplayProperty) {
this.listDisplayProperty = listDisplayProperty;
}

public void setListInput(ListInputType.ListInput listInput) {
this.listInput = listInput;
}

public ListInputType.ListInput getListInput() {
return listInput;
}

public String getHintBrowseFile() {
return hintBrowseFile;
}
Expand Down

This file was deleted.

0 comments on commit 2e1701b

Please sign in to comment.