Skip to content

Commit

Permalink
[KOGITO-9758] Supporting arrays as query parameters for openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Aug 28, 2023
1 parent ed0f3c4 commit 2b05535
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.jboss.jandex.Type;
import org.kie.kogito.codegen.api.context.KogitoBuildContext;

import com.github.javaparser.ast.NodeList;

import static com.github.javaparser.StaticJavaParser.parseClassOrInterfaceType;
import static com.github.javaparser.StaticJavaParser.parseType;

Expand All @@ -46,6 +48,9 @@ protected final com.github.javaparser.ast.type.Type fromClass(Type param) {
return parseClassOrInterfaceType(param.asClassType().name().toString());
case PRIMITIVE:
return parseType(param.asPrimitiveType().name().toString());
case PARAMETERIZED_TYPE:
return parseClassOrInterfaceType(param.asParameterizedType().name().toString())
.setTypeArguments(NodeList.nodeList(param.asParameterizedType().arguments().stream().map(this::fromClass).collect(Collectors.toList())));
default:
throw new UnsupportedOperationException("Kind " + param.kind() + " is not supported");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ paths:
schema:
type: string
required: true
- in: query
name: unusedList
required: false
schema:
type: array
items:
type: string
requestBody:
content:
application/json:
Expand All @@ -33,10 +40,15 @@ components:
schemas:
MultiplicationOperation:
type: object
required: [leftElement,rightElement]
properties:
leftElement:
format: float
type: number
rightElement:
format: float
type: number
type: number
unusedElement:
type: array
items:
type: string

0 comments on commit 2b05535

Please sign in to comment.