Skip to content

Commit

Permalink
Merge branch 'main' into signall-babel
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- authored Jun 25, 2024
2 parents ec54103 + 01d2d55 commit 01763e5
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import javax.annotation.Nonnull;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.vaadin.hilla.mappedtypes.Order;
import com.vaadin.hilla.mappedtypes.Pageable;
import com.vaadin.hilla.mappedtypes.Sort;
Expand Down Expand Up @@ -44,6 +46,8 @@ public final class TransferTypesPlugin
classMap.put("com.vaadin.hilla.EndpointSubscription",
EndpointSubscription.class);
classMap.put(JsonNode.class.getName(), Object.class);
classMap.put(ObjectNode.class.getName(), Object.class);
classMap.put(ArrayNode.class.getName(), List.class);
}

public TransferTypesPlugin() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
package com.vaadin.hilla.parser.plugins.transfertypes.jsonnode;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

@Endpoint
public class JsonNodeEndpoint {
public JsonNode echo(JsonNode node) {
public JsonNode jsonNode(JsonNode node) {
return node;
}

public ObjectNode objectNode(ObjectNode node) {
return node;
}

public ArrayNode arrayNode(ArrayNode node) {
return node;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.vaadin.hilla.parser.plugins.transfertypes.jsonnode;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE_USE })
public @interface Nonnull {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.vaadin.hilla.parser.plugins.transfertypes.jsonnode;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE_USE })
public @interface Nullable {
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,82 @@
}
],
"paths" : {
"/JsonNodeEndpoint/echo" : {
"/JsonNodeEndpoint/arrayNode" : {
"post" : {
"tags" : [
"JsonNodeEndpoint"
],
"operationId" : "JsonNodeEndpoint_echo_POST",
"operationId" : "JsonNodeEndpoint_arrayNode_POST",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "object",
"properties" : {
"node" : {
"type" : "array",
"nullable" : true
}
}
}
}
}
},
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"type" : "array",
"nullable" : true
}
}
}
}
}
}
},
"/JsonNodeEndpoint/jsonNode" : {
"post" : {
"tags" : [
"JsonNodeEndpoint"
],
"operationId" : "JsonNodeEndpoint_jsonNode_POST",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "object",
"properties" : {
"node" : {
"type" : "object"
}
}
}
}
}
},
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
}
}
}
}
}
}
},
"/JsonNodeEndpoint/objectNode" : {
"post" : {
"tags" : [
"JsonNodeEndpoint"
],
"operationId" : "JsonNodeEndpoint_objectNode_POST",
"requestBody" : {
"content" : {
"application/json" : {
Expand Down

0 comments on commit 01763e5

Please sign in to comment.