Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from hathora/jc/java-apps-fix
Browse files Browse the repository at this point in the history
adding patch and fix for incorrect validation logic for  on Application types
  • Loading branch information
jchu231 authored Sep 11, 2024
2 parents 6cd76a9 + 7cb18ce commit c5f6ce0
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 9 deletions.
54 changes: 54 additions & 0 deletions java/post-java-generation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,57 @@ diff --git a/java/src/main/java/com/hathora/client/model/Room.java b/java/src/ma
if (!jsonObj.get("roomId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `roomId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roomId").toString()));
}
Index: java/src/main/java/com/hathora/client/model/Application.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/java/src/main/java/com/hathora/client/model/Application.java b/java/src/main/java/com/hathora/client/model/Application.java
--- a/java/src/main/java/com/hathora/client/model/Application.java (revision 6cd76a9d6f9d0ba930f5b05736746b842730bcc4)
+++ b/java/src/main/java/com/hathora/client/model/Application.java (date 1726084569527)
@@ -436,9 +436,6 @@
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
- if (!jsonObj.get("deletedBy").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `deletedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletedBy").toString()));
- }
if (!jsonObj.get("createdBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString()));
}
Index: java/src/main/java/com/hathora/client/model/ApplicationWithLatestDeploymentAndBuild.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/java/src/main/java/com/hathora/client/model/ApplicationWithLatestDeploymentAndBuild.java b/java/src/main/java/com/hathora/client/model/ApplicationWithLatestDeploymentAndBuild.java
--- a/java/src/main/java/com/hathora/client/model/ApplicationWithLatestDeploymentAndBuild.java (revision 6cd76a9d6f9d0ba930f5b05736746b842730bcc4)
+++ b/java/src/main/java/com/hathora/client/model/ApplicationWithLatestDeploymentAndBuild.java (date 1726084569530)
@@ -466,9 +466,6 @@
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
- if (!jsonObj.get("deletedBy").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `deletedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletedBy").toString()));
- }
if (!jsonObj.get("createdBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString()));
}
Index: java/src/main/java/com/hathora/client/model/ApplicationWithDeployment.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/java/src/main/java/com/hathora/client/model/ApplicationWithDeployment.java b/java/src/main/java/com/hathora/client/model/ApplicationWithDeployment.java
--- a/java/src/main/java/com/hathora/client/model/ApplicationWithDeployment.java (revision 6cd76a9d6f9d0ba930f5b05736746b842730bcc4)
+++ b/java/src/main/java/com/hathora/client/model/ApplicationWithDeployment.java (date 1726084569533)
@@ -467,9 +467,6 @@
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
- if (!jsonObj.get("deletedBy").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `deletedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletedBy").toString()));
- }
if (!jsonObj.get("createdBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString()));
}
3 changes: 0 additions & 3 deletions java/src/main/java/com/hathora/client/model/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("deletedBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `deletedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletedBy").toString()));
}
if (!jsonObj.get("createdBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("deletedBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `deletedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletedBy").toString()));
}
if (!jsonObj.get("createdBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("deletedBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `deletedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletedBy").toString()));
}
if (!jsonObj.get("createdBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString()));
}
Expand Down

0 comments on commit c5f6ce0

Please sign in to comment.