-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/3099/Server-side-validators-not-working-…
…correctly-with-array-form-binding
- Loading branch information
Showing
4 changed files
with
206 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
.../hilla/parser/plugins/backbone/jsonvaluenojsoncreator/JsonCreatorNoJsonValueEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.vaadin.hilla.parser.plugins.backbone.jsonvaluenojsoncreator; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@Endpoint | ||
public class JsonCreatorNoJsonValueEndpoint { | ||
|
||
public static class User { | ||
|
||
private final String name; | ||
private final int age; | ||
|
||
// Default constructor | ||
public User() { | ||
this.name = "Unknown"; | ||
this.age = 0; | ||
} | ||
|
||
// Constructor used during deserialization | ||
@JsonCreator | ||
public User(@JsonProperty("name") String n, | ||
@JsonProperty("age") int a) { | ||
name = n; | ||
age = a; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public int getAge() { | ||
return age; | ||
} | ||
} | ||
|
||
public User getUser() { | ||
return new User("John Doe", 42); | ||
} | ||
|
||
public void setUser(User user) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
...st/resources/com/vaadin/hilla/parser/plugins/backbone/jsonvaluenojsoncreator/openapi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "Hilla Application", | ||
"version": "1.0.0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost:8080/connect", | ||
"description": "Hilla Backend" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"name": "JsonValueNoJsonCreatorEndpoint", | ||
"x-class-name": "com.vaadin.hilla.parser.plugins.backbone.jsonvaluenojsoncreator.JsonValueNoJsonCreatorEndpoint" | ||
}, | ||
{ | ||
"name": "JsonCreatorNoJsonValueEndpoint", | ||
"x-class-name": "com.vaadin.hilla.parser.plugins.backbone.jsonvaluenojsoncreator.JsonCreatorNoJsonValueEndpoint" | ||
} | ||
], | ||
"paths": { | ||
"/JsonValueNoJsonCreatorEndpoint/getEmail": { | ||
"post": { | ||
"tags": [ | ||
"JsonValueNoJsonCreatorEndpoint" | ||
], | ||
"operationId": "JsonValueNoJsonCreatorEndpoint_getEmail_POST", | ||
"responses": { | ||
"200": { | ||
"description": "", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "string", | ||
"nullable": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/JsonValueNoJsonCreatorEndpoint/setEmail": { | ||
"post": { | ||
"tags": [ | ||
"JsonValueNoJsonCreatorEndpoint" | ||
], | ||
"operationId": "JsonValueNoJsonCreatorEndpoint_setEmail_POST", | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"email": { | ||
"type": "string", | ||
"nullable": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
}, | ||
"/JsonCreatorNoJsonValueEndpoint/getUser": { | ||
"post": { | ||
"tags": [ | ||
"JsonCreatorNoJsonValueEndpoint" | ||
], | ||
"operationId": "JsonCreatorNoJsonValueEndpoint_getUser_POST", | ||
"responses": { | ||
"200": { | ||
"description": "", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"nullable": true, | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/components/schemas/com.vaadin.hilla.parser.plugins.backbone.jsonvaluenojsoncreator.JsonCreatorNoJsonValueEndpoint$User" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/JsonCreatorNoJsonValueEndpoint/setUser": { | ||
"post": { | ||
"tags": [ | ||
"JsonCreatorNoJsonValueEndpoint" | ||
], | ||
"operationId": "JsonCreatorNoJsonValueEndpoint_setUser_POST", | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"user": { | ||
"nullable": true, | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/components/schemas/com.vaadin.hilla.parser.plugins.backbone.jsonvaluenojsoncreator.JsonCreatorNoJsonValueEndpoint$User" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"com.vaadin.hilla.parser.plugins.backbone.jsonvaluenojsoncreator.JsonCreatorNoJsonValueEndpoint$User": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"nullable": true | ||
}, | ||
"age": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |