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

POC for Polymorphism #890

Merged
merged 22 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test(core): minor changes
  • Loading branch information
timonback committed Sep 7, 2024
commit db2a5bc449fdc09c58696cac4141ee61ab79f782
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato
JavaType javaType = Json.mapper().constructType(type.getType());
if (chain.hasNext()) {
Schema<?> schema = chain.next().resolve(type, context, chain);
if (schema != null && PrimitiveType.createProperty(type.getType()) == null) {
boolean isPrimitiveType = PrimitiveType.createProperty(type.getType()) != null;
if (schema != null && !isPrimitiveType) {
if (schema.get$ref() != null) {
Schema<?> defModel = context.resolve(type);
timonback marked this conversation as resolved.
Show resolved Hide resolved
if (defModel != null && defModel.getTitle() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ void scan_componentHasListenerMethodWithAllAttributes() {

// Then the returned collection contains the channel
MessagePayload payload = MessagePayload.of(MultiFormatSchema.builder()
.schema(SchemaReference.fromSchema(String.class.getSimpleName()))
.schema(SchemaReference.fromSchema(List.class.getSimpleName()))
.build());

MessageObject message = MessageObject.builder()
.messageId(String.class.getName())
.name(String.class.getName())
.title(String.class.getName())
.messageId(List.class.getName())
.name(List.class.getName())
.title(List.class.getSimpleName())
.description(null)
timonback marked this conversation as resolved.
Show resolved Hide resolved
.payload(payload)
.headers(MessageHeaders.of(MessageReference.toSchema("TestSchema")))
Expand Down Expand Up @@ -331,7 +331,7 @@ private static class ClassWithListenerAnnotationWithAllAttributes {
@AsyncOperation(
channelName = "${test.property.test-channel}",
description = "${test.property.description}",
payloadType = String.class,
payloadType = List.class,
servers = {"${test.property.server1}", "${test.property.server2}"},
headers =
@AsyncOperation.Headers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void setUp() throws NoSuchMethodException {
when(payloadMethodService.extractSchema(simpleFooMethod))
.thenReturn(new PayloadSchemaObject(
SimpleFoo.class.getName(),
String.class.getSimpleName(),
SimpleFoo.class.getSimpleName(),
ComponentSchema.of(new SchemaObject())));
}

Expand Down