Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KOGITO-9758] Supporting arrays as query parameters for openapi #3190

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading