diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2017-04-06 23:39:48 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2017-04-06 23:39:48 +0200 |
commit | fbc71c3f4648058f874e5890f501929b1e6feb31 (patch) | |
tree | 243e2f115d7580761d5efeb8a149a8448c8f4820 | |
parent | Remove traversal of transient fields (diff) | |
download | seven-wonders-fbc71c3f4648058f874e5890f501929b1e6feb31.tar.gz seven-wonders-fbc71c3f4648058f874e5890f501929b1e6feb31.tar.bz2 seven-wonders-fbc71c3f4648058f874e5890f501929b1e6feb31.zip |
Add ApiObjectField annotations in actions
6 files changed, 11 insertions, 2 deletions
diff --git a/backend/src/main/java/org/luxons/sevenwonders/actions/ChooseNameAction.java b/backend/src/main/java/org/luxons/sevenwonders/actions/ChooseNameAction.java index fb5f7ec9..be5e97ea 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/actions/ChooseNameAction.java +++ b/backend/src/main/java/org/luxons/sevenwonders/actions/ChooseNameAction.java @@ -12,8 +12,7 @@ import org.jsondoc.core.annotation.ApiObjectField; public class ChooseNameAction { @ApiObjectField(description = "The display name of the player. May contain spaces and special characters.", - required = true, - format = ".{2,20}") + required = true) @NotNull @Size(min = 2, max = 20) private String playerName; diff --git a/backend/src/main/java/org/luxons/sevenwonders/actions/CreateGameAction.java b/backend/src/main/java/org/luxons/sevenwonders/actions/CreateGameAction.java index ed96f18c..4ad957b8 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/actions/CreateGameAction.java +++ b/backend/src/main/java/org/luxons/sevenwonders/actions/CreateGameAction.java @@ -4,12 +4,14 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.jsondoc.core.annotation.ApiObject; +import org.jsondoc.core.annotation.ApiObjectField; @ApiObject(name = "Create Game Action", description = "The action to create a game.", group = "Actions") public class CreateGameAction { + @ApiObjectField @NotNull @Size(min = 2, max = 30) private String gameName; diff --git a/backend/src/main/java/org/luxons/sevenwonders/actions/JoinGameAction.java b/backend/src/main/java/org/luxons/sevenwonders/actions/JoinGameAction.java index 5c7a5f03..a392378c 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/actions/JoinGameAction.java +++ b/backend/src/main/java/org/luxons/sevenwonders/actions/JoinGameAction.java @@ -3,12 +3,14 @@ package org.luxons.sevenwonders.actions; import javax.validation.constraints.NotNull; import org.jsondoc.core.annotation.ApiObject; +import org.jsondoc.core.annotation.ApiObjectField; @ApiObject(name = "Join Game Action", description = "The action to join a game.", group = "Actions") public class JoinGameAction { + @ApiObjectField @NotNull private Long gameId; diff --git a/backend/src/main/java/org/luxons/sevenwonders/actions/PrepareCardAction.java b/backend/src/main/java/org/luxons/sevenwonders/actions/PrepareCardAction.java index 0fc9f0ac..629e5806 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/actions/PrepareCardAction.java +++ b/backend/src/main/java/org/luxons/sevenwonders/actions/PrepareCardAction.java @@ -3,6 +3,7 @@ package org.luxons.sevenwonders.actions; import javax.validation.constraints.NotNull; import org.jsondoc.core.annotation.ApiObject; +import org.jsondoc.core.annotation.ApiObjectField; import org.luxons.sevenwonders.game.api.PlayerMove; @ApiObject(name = "Prepare Card Action", @@ -10,6 +11,7 @@ import org.luxons.sevenwonders.game.api.PlayerMove; group = "Actions") public class PrepareCardAction { + @ApiObjectField @NotNull private PlayerMove move; diff --git a/backend/src/main/java/org/luxons/sevenwonders/actions/ReorderPlayersAction.java b/backend/src/main/java/org/luxons/sevenwonders/actions/ReorderPlayersAction.java index dedca3fe..e457caf4 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/actions/ReorderPlayersAction.java +++ b/backend/src/main/java/org/luxons/sevenwonders/actions/ReorderPlayersAction.java @@ -5,6 +5,7 @@ import java.util.List; import javax.validation.constraints.NotNull; import org.jsondoc.core.annotation.ApiObject; +import org.jsondoc.core.annotation.ApiObjectField; @ApiObject(name = "Reorder Players Action", description = "The action to update the order of the players around the table. Can only be called in the " @@ -12,6 +13,7 @@ import org.jsondoc.core.annotation.ApiObject; group = "Actions") public class ReorderPlayersAction { + @ApiObjectField @NotNull private List<String> orderedPlayers; diff --git a/backend/src/main/java/org/luxons/sevenwonders/actions/UpdateSettingsAction.java b/backend/src/main/java/org/luxons/sevenwonders/actions/UpdateSettingsAction.java index e6a69e5b..fa454995 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/actions/UpdateSettingsAction.java +++ b/backend/src/main/java/org/luxons/sevenwonders/actions/UpdateSettingsAction.java @@ -3,6 +3,7 @@ package org.luxons.sevenwonders.actions; import javax.validation.constraints.NotNull; import org.jsondoc.core.annotation.ApiObject; +import org.jsondoc.core.annotation.ApiObjectField; import org.luxons.sevenwonders.game.api.CustomizableSettings; @ApiObject(name = "Update Settings Action", @@ -11,6 +12,7 @@ import org.luxons.sevenwonders.game.api.CustomizableSettings; group = "Actions") public class UpdateSettingsAction { + @ApiObjectField @NotNull private CustomizableSettings settings; |