diff --git a/.sdk-version b/.sdk-version
index 8a5b818..1defe53 100644
--- a/.sdk-version
+++ b/.sdk-version
@@ -1 +1 @@
-v2.0.4
+v2.1.0
diff --git a/README.md b/README.md
index fe747f6..a184c5a 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Add this dependency to your project's POM:
ai.reveng
sdk
- 2.0.4
+ 2.1.0
compile
```
@@ -31,7 +31,7 @@ repositories {
}
dependencies {
- implementation "ai.reveng:sdk:2.0.4"
+ implementation "ai.reveng:sdk:2.1.0"
}
```
diff --git a/build.gradle b/build.gradle
index 0959728..fbbecfc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,7 +19,7 @@ apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'
group = 'ai.reveng'
-version = '2.0.4'
+version = '2.1.0'
@@ -171,7 +171,7 @@ mavenPublishing {
publishToMavenCentral(true)
signAllPublications()
- coordinates("ai.reveng", "sdk", "2.0.4")
+ coordinates("ai.reveng", "sdk", "2.1.0")
pom {
name = "sdk"
diff --git a/build.sbt b/build.sbt
index d096f03..6d60368 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "ai.reveng",
name := "sdk",
- version := "2.0.4",
+ version := "2.1.0",
scalaVersion := "2.11.12",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
diff --git a/docs/AppApiRestV2FunctionsResponsesFunction.md b/docs/AppApiRestV2FunctionsResponsesFunction.md
index 6d9bbd8..be7aeb0 100644
--- a/docs/AppApiRestV2FunctionsResponsesFunction.md
+++ b/docs/AppApiRestV2FunctionsResponsesFunction.md
@@ -8,7 +8,7 @@ Function schema used in function strings response.
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
-|**functionId** | **Integer** | | |
+|**functionId** | **Integer** | | [optional] |
|**functionVaddr** | **Long** | Function virtual address | |
diff --git a/pom.xml b/pom.xml
index 5815d3e..e59f99a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
sdk
jar
sdk
- 2.0.4
+ 2.1.0
https://github.com/RevEngAI/sdk-java
Java SDK for the RevEng.AI API
diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java
index 8a2b67d..6206715 100644
--- a/src/main/java/ai/reveng/invoker/ApiClient.java
+++ b/src/main/java/ai/reveng/invoker/ApiClient.java
@@ -140,7 +140,7 @@ protected void init() {
json = new JSON();
// Set default User-Agent.
- setUserAgent("OpenAPI-Generator/2.0.4/java");
+ setUserAgent("OpenAPI-Generator/2.1.0/java");
authentications = new HashMap();
}
diff --git a/src/main/java/ai/reveng/invoker/Configuration.java b/src/main/java/ai/reveng/invoker/Configuration.java
index cf7dbd9..cfb5acf 100644
--- a/src/main/java/ai/reveng/invoker/Configuration.java
+++ b/src/main/java/ai/reveng/invoker/Configuration.java
@@ -18,7 +18,7 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Configuration {
- public static final String VERSION = "2.0.4";
+ public static final String VERSION = "2.1.0";
private static final AtomicReference defaultApiClient = new AtomicReference<>();
private static volatile Supplier apiClientFactory = ApiClient::new;
diff --git a/src/main/java/ai/reveng/model/AiUnstripRequest.java b/src/main/java/ai/reveng/model/AiUnstripRequest.java
index 23d865d..619c107 100644
--- a/src/main/java/ai/reveng/model/AiUnstripRequest.java
+++ b/src/main/java/ai/reveng/model/AiUnstripRequest.java
@@ -77,6 +77,50 @@ public void setApply(@javax.annotation.Nullable Boolean apply) {
this.apply = apply;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AiUnstripRequest instance itself
+ */
+ public AiUnstripRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -88,12 +132,13 @@ public boolean equals(Object o) {
return false;
}
AiUnstripRequest aiUnstripRequest = (AiUnstripRequest) o;
- return Objects.equals(this.apply, aiUnstripRequest.apply);
+ return Objects.equals(this.apply, aiUnstripRequest.apply)&&
+ Objects.equals(this.additionalProperties, aiUnstripRequest.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(apply);
+ return Objects.hash(apply, additionalProperties);
}
@Override
@@ -101,6 +146,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AiUnstripRequest {\n");
sb.append(" apply: ").append(toIndentedString(apply)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -140,14 +186,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AiUnstripRequest is not found in the empty JSON string", AiUnstripRequest.openapiRequiredFields.toString()));
}
}
-
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AiUnstripRequest.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AiUnstripRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
JsonObject jsonObj = jsonElement.getAsJsonObject();
}
@@ -166,6 +204,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AiUnstripRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -173,7 +233,28 @@ public void write(JsonWriter out, AiUnstripRequest value) throws IOException {
public AiUnstripRequest read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AiUnstripRequest instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisAccessInfo.java b/src/main/java/ai/reveng/model/AnalysisAccessInfo.java
index ffeaef5..a28f4d1 100644
--- a/src/main/java/ai/reveng/model/AnalysisAccessInfo.java
+++ b/src/main/java/ai/reveng/model/AnalysisAccessInfo.java
@@ -101,6 +101,50 @@ public void setUsername(@javax.annotation.Nonnull String username) {
this.username = username;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisAccessInfo instance itself
+ */
+ public AnalysisAccessInfo putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -113,12 +157,13 @@ public boolean equals(Object o) {
}
AnalysisAccessInfo analysisAccessInfo = (AnalysisAccessInfo) o;
return Objects.equals(this.owner, analysisAccessInfo.owner) &&
- Objects.equals(this.username, analysisAccessInfo.username);
+ Objects.equals(this.username, analysisAccessInfo.username)&&
+ Objects.equals(this.additionalProperties, analysisAccessInfo.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(owner, username);
+ return Objects.hash(owner, username, additionalProperties);
}
@Override
@@ -127,6 +172,7 @@ public String toString() {
sb.append("class AnalysisAccessInfo {\n");
sb.append(" owner: ").append(toIndentedString(owner)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -167,14 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisAccessInfo.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisAccessInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisAccessInfo.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -202,6 +240,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisAccessInfo value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -209,7 +269,28 @@ public void write(JsonWriter out, AnalysisAccessInfo value) throws IOException {
public AnalysisAccessInfo read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisAccessInfo instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisConfig.java b/src/main/java/ai/reveng/model/AnalysisConfig.java
index 8f05d83..d89bdf3 100644
--- a/src/main/java/ai/reveng/model/AnalysisConfig.java
+++ b/src/main/java/ai/reveng/model/AnalysisConfig.java
@@ -223,6 +223,50 @@ public void setSandboxConfig(@javax.annotation.Nullable SandboxOptions sandboxCo
this.sandboxConfig = sandboxConfig;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisConfig instance itself
+ */
+ public AnalysisConfig putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -240,12 +284,13 @@ public boolean equals(Object o) {
Objects.equals(this.generateCapabilities, analysisConfig.generateCapabilities) &&
Objects.equals(this.noCache, analysisConfig.noCache) &&
Objects.equals(this.advancedAnalysis, analysisConfig.advancedAnalysis) &&
- Objects.equals(this.sandboxConfig, analysisConfig.sandboxConfig);
+ Objects.equals(this.sandboxConfig, analysisConfig.sandboxConfig)&&
+ Objects.equals(this.additionalProperties, analysisConfig.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(scrapeThirdPartyConfig, generateCves, generateSbom, generateCapabilities, noCache, advancedAnalysis, sandboxConfig);
+ return Objects.hash(scrapeThirdPartyConfig, generateCves, generateSbom, generateCapabilities, noCache, advancedAnalysis, sandboxConfig, additionalProperties);
}
@Override
@@ -259,6 +304,7 @@ public String toString() {
sb.append(" noCache: ").append(toIndentedString(noCache)).append("\n");
sb.append(" advancedAnalysis: ").append(toIndentedString(advancedAnalysis)).append("\n");
sb.append(" sandboxConfig: ").append(toIndentedString(sandboxConfig)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -298,14 +344,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AnalysisConfig is not found in the empty JSON string", AnalysisConfig.openapiRequiredFields.toString()));
}
}
-
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisConfig.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the optional field `scrape_third_party_config`
if (jsonObj.get("scrape_third_party_config") != null && !jsonObj.get("scrape_third_party_config").isJsonNull()) {
@@ -332,6 +370,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisConfig value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -339,7 +399,28 @@ public void write(JsonWriter out, AnalysisConfig value) throws IOException {
public AnalysisConfig read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisConfig instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisCreateRequest.java b/src/main/java/ai/reveng/model/AnalysisCreateRequest.java
index a591dd4..378d186 100644
--- a/src/main/java/ai/reveng/model/AnalysisCreateRequest.java
+++ b/src/main/java/ai/reveng/model/AnalysisCreateRequest.java
@@ -261,6 +261,50 @@ public void setBinaryConfig(@javax.annotation.Nullable BinaryConfig binaryConfig
this.binaryConfig = binaryConfig;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisCreateRequest instance itself
+ */
+ public AnalysisCreateRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -279,7 +323,8 @@ public boolean equals(Object o) {
Objects.equals(this.symbols, analysisCreateRequest.symbols) &&
Objects.equals(this.debugHash, analysisCreateRequest.debugHash) &&
Objects.equals(this.analysisConfig, analysisCreateRequest.analysisConfig) &&
- Objects.equals(this.binaryConfig, analysisCreateRequest.binaryConfig);
+ Objects.equals(this.binaryConfig, analysisCreateRequest.binaryConfig)&&
+ Objects.equals(this.additionalProperties, analysisCreateRequest.additionalProperties);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
@@ -288,7 +333,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b)
@Override
public int hashCode() {
- return Objects.hash(filename, sha256Hash, tags, analysisScope, symbols, debugHash, analysisConfig, binaryConfig);
+ return Objects.hash(filename, sha256Hash, tags, analysisScope, symbols, debugHash, analysisConfig, binaryConfig, additionalProperties);
}
private static int hashCodeNullable(JsonNullable a) {
@@ -310,6 +355,7 @@ public String toString() {
sb.append(" debugHash: ").append(toIndentedString(debugHash)).append("\n");
sb.append(" analysisConfig: ").append(toIndentedString(analysisConfig)).append("\n");
sb.append(" binaryConfig: ").append(toIndentedString(binaryConfig)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -350,14 +396,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisCreateRequest.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisCreateRequest.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -421,6 +459,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisCreateRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -428,7 +488,28 @@ public void write(JsonWriter out, AnalysisCreateRequest value) throws IOExceptio
public AnalysisCreateRequest read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisCreateRequest instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisCreateResponse.java b/src/main/java/ai/reveng/model/AnalysisCreateResponse.java
index dd1f2ae..73ab0d6 100644
--- a/src/main/java/ai/reveng/model/AnalysisCreateResponse.java
+++ b/src/main/java/ai/reveng/model/AnalysisCreateResponse.java
@@ -101,6 +101,50 @@ public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) {
this.binaryId = binaryId;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisCreateResponse instance itself
+ */
+ public AnalysisCreateResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -113,12 +157,13 @@ public boolean equals(Object o) {
}
AnalysisCreateResponse analysisCreateResponse = (AnalysisCreateResponse) o;
return Objects.equals(this.analysisId, analysisCreateResponse.analysisId) &&
- Objects.equals(this.binaryId, analysisCreateResponse.binaryId);
+ Objects.equals(this.binaryId, analysisCreateResponse.binaryId)&&
+ Objects.equals(this.additionalProperties, analysisCreateResponse.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(analysisId, binaryId);
+ return Objects.hash(analysisId, binaryId, additionalProperties);
}
@Override
@@ -127,6 +172,7 @@ public String toString() {
sb.append("class AnalysisCreateResponse {\n");
sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n");
sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -167,14 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisCreateResponse.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisCreateResponse.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -199,6 +237,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisCreateResponse value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -206,7 +266,28 @@ public void write(JsonWriter out, AnalysisCreateResponse value) throws IOExcepti
public AnalysisCreateResponse read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisCreateResponse instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisDetailResponse.java b/src/main/java/ai/reveng/model/AnalysisDetailResponse.java
index 33bd682..8ca2b2a 100644
--- a/src/main/java/ai/reveng/model/AnalysisDetailResponse.java
+++ b/src/main/java/ai/reveng/model/AnalysisDetailResponse.java
@@ -401,6 +401,50 @@ public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) {
this.sha256Hash = sha256Hash;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisDetailResponse instance itself
+ */
+ public AnalysisDetailResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -425,7 +469,8 @@ public boolean equals(Object o) {
Objects.equals(this.debug, analysisDetailResponse.debug) &&
Objects.equals(this.modelName, analysisDetailResponse.modelName) &&
Objects.equals(this.sbom, analysisDetailResponse.sbom) &&
- Objects.equals(this.sha256Hash, analysisDetailResponse.sha256Hash);
+ Objects.equals(this.sha256Hash, analysisDetailResponse.sha256Hash)&&
+ Objects.equals(this.additionalProperties, analysisDetailResponse.additionalProperties);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
@@ -434,7 +479,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b)
@Override
public int hashCode() {
- return Objects.hash(access, analysisId, analysisScope, architecture, binaryDynamic, binaryFormat, binaryName, binarySize, binaryType, creation, debug, modelName, sbom, sha256Hash);
+ return Objects.hash(access, analysisId, analysisScope, architecture, binaryDynamic, binaryFormat, binaryName, binarySize, binaryType, creation, debug, modelName, sbom, sha256Hash, additionalProperties);
}
private static int hashCodeNullable(JsonNullable a) {
@@ -462,6 +507,7 @@ public String toString() {
sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n");
sb.append(" sbom: ").append(toIndentedString(sbom)).append("\n");
sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -502,14 +548,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisDetailResponse.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisDetailResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisDetailResponse.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -560,6 +598,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisDetailResponse value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -567,7 +627,28 @@ public void write(JsonWriter out, AnalysisDetailResponse value) throws IOExcepti
public AnalysisDetailResponse read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisDetailResponse instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionMapping.java b/src/main/java/ai/reveng/model/AnalysisFunctionMapping.java
index 55bd5a1..c5875bb 100644
--- a/src/main/java/ai/reveng/model/AnalysisFunctionMapping.java
+++ b/src/main/java/ai/reveng/model/AnalysisFunctionMapping.java
@@ -78,6 +78,50 @@ public void setFunctionMaps(@javax.annotation.Nonnull FunctionMapping functionMa
this.functionMaps = functionMaps;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisFunctionMapping instance itself
+ */
+ public AnalysisFunctionMapping putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -89,12 +133,13 @@ public boolean equals(Object o) {
return false;
}
AnalysisFunctionMapping analysisFunctionMapping = (AnalysisFunctionMapping) o;
- return Objects.equals(this.functionMaps, analysisFunctionMapping.functionMaps);
+ return Objects.equals(this.functionMaps, analysisFunctionMapping.functionMaps)&&
+ Objects.equals(this.additionalProperties, analysisFunctionMapping.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(functionMaps);
+ return Objects.hash(functionMaps, additionalProperties);
}
@Override
@@ -102,6 +147,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnalysisFunctionMapping {\n");
sb.append(" functionMaps: ").append(toIndentedString(functionMaps)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisFunctionMapping.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisFunctionMapping` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisFunctionMapping.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -176,6 +214,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisFunctionMapping value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -183,7 +243,28 @@ public void write(JsonWriter out, AnalysisFunctionMapping value) throws IOExcept
public AnalysisFunctionMapping read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisFunctionMapping instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java b/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java
index fac70d4..900d86e 100644
--- a/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java
+++ b/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java
@@ -183,6 +183,50 @@ public void setPageSize(@javax.annotation.Nullable Integer pageSize) {
this.pageSize = pageSize;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisFunctionMatchingRequest instance itself
+ */
+ public AnalysisFunctionMatchingRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -198,7 +242,8 @@ public boolean equals(Object o) {
Objects.equals(this.filters, analysisFunctionMatchingRequest.filters) &&
Objects.equals(this.resultsPerFunction, analysisFunctionMatchingRequest.resultsPerFunction) &&
Objects.equals(this.page, analysisFunctionMatchingRequest.page) &&
- Objects.equals(this.pageSize, analysisFunctionMatchingRequest.pageSize);
+ Objects.equals(this.pageSize, analysisFunctionMatchingRequest.pageSize)&&
+ Objects.equals(this.additionalProperties, analysisFunctionMatchingRequest.additionalProperties);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
@@ -207,7 +252,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b)
@Override
public int hashCode() {
- return Objects.hash(minSimilarity, filters, resultsPerFunction, page, pageSize);
+ return Objects.hash(minSimilarity, filters, resultsPerFunction, page, pageSize, additionalProperties);
}
private static int hashCodeNullable(JsonNullable a) {
@@ -226,6 +271,7 @@ public String toString() {
sb.append(" resultsPerFunction: ").append(toIndentedString(resultsPerFunction)).append("\n");
sb.append(" page: ").append(toIndentedString(page)).append("\n");
sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -265,14 +311,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AnalysisFunctionMatchingRequest is not found in the empty JSON string", AnalysisFunctionMatchingRequest.openapiRequiredFields.toString()));
}
}
-
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisFunctionMatchingRequest.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisFunctionMatchingRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the optional field `filters`
if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) {
@@ -295,6 +333,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisFunctionMatchingRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -302,7 +362,28 @@ public void write(JsonWriter out, AnalysisFunctionMatchingRequest value) throws
public AnalysisFunctionMatchingRequest read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisFunctionMatchingRequest instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisFunctions.java b/src/main/java/ai/reveng/model/AnalysisFunctions.java
index c1cdc8a..c0f3281 100644
--- a/src/main/java/ai/reveng/model/AnalysisFunctions.java
+++ b/src/main/java/ai/reveng/model/AnalysisFunctions.java
@@ -88,6 +88,50 @@ public void setFunctions(@javax.annotation.Nonnull List additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisFunctions instance itself
+ */
+ public AnalysisFunctions putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -99,12 +143,13 @@ public boolean equals(Object o) {
return false;
}
AnalysisFunctions analysisFunctions = (AnalysisFunctions) o;
- return Objects.equals(this.functions, analysisFunctions.functions);
+ return Objects.equals(this.functions, analysisFunctions.functions)&&
+ Objects.equals(this.additionalProperties, analysisFunctions.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(functions);
+ return Objects.hash(functions, additionalProperties);
}
@Override
@@ -112,6 +157,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnalysisFunctions {\n");
sb.append(" functions: ").append(toIndentedString(functions)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -152,14 +198,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisFunctions.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisFunctions` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisFunctions.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -194,6 +232,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisFunctions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -201,7 +261,28 @@ public void write(JsonWriter out, AnalysisFunctions value) throws IOException {
public AnalysisFunctions read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisFunctions instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisRecord.java b/src/main/java/ai/reveng/model/AnalysisRecord.java
index 29ae260..66901a4 100644
--- a/src/main/java/ai/reveng/model/AnalysisRecord.java
+++ b/src/main/java/ai/reveng/model/AnalysisRecord.java
@@ -440,6 +440,50 @@ public void setBaseAddress(@javax.annotation.Nonnull Long baseAddress) {
this.baseAddress = baseAddress;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisRecord instance itself
+ */
+ public AnalysisRecord putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -466,7 +510,8 @@ public boolean equals(Object o) {
Objects.equals(this.username, analysisRecord.username) &&
Objects.equals(this.dynamicExecutionStatus, analysisRecord.dynamicExecutionStatus) &&
Objects.equals(this.dynamicExecutionTaskId, analysisRecord.dynamicExecutionTaskId) &&
- Objects.equals(this.baseAddress, analysisRecord.baseAddress);
+ Objects.equals(this.baseAddress, analysisRecord.baseAddress)&&
+ Objects.equals(this.additionalProperties, analysisRecord.additionalProperties);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
@@ -475,7 +520,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b)
@Override
public int hashCode() {
- return Objects.hash(analysisId, analysisScope, binaryId, modelId, modelName, status, creation, isOwner, binaryName, sha256Hash, functionBoundariesHash, binarySize, username, dynamicExecutionStatus, dynamicExecutionTaskId, baseAddress);
+ return Objects.hash(analysisId, analysisScope, binaryId, modelId, modelName, status, creation, isOwner, binaryName, sha256Hash, functionBoundariesHash, binarySize, username, dynamicExecutionStatus, dynamicExecutionTaskId, baseAddress, additionalProperties);
}
private static int hashCodeNullable(JsonNullable a) {
@@ -505,6 +550,7 @@ public String toString() {
sb.append(" dynamicExecutionStatus: ").append(toIndentedString(dynamicExecutionStatus)).append("\n");
sb.append(" dynamicExecutionTaskId: ").append(toIndentedString(dynamicExecutionTaskId)).append("\n");
sb.append(" baseAddress: ").append(toIndentedString(baseAddress)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -545,14 +591,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisRecord.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisRecord` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisRecord.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -602,6 +640,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisRecord value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -609,7 +669,28 @@ public void write(JsonWriter out, AnalysisRecord value) throws IOException {
public AnalysisRecord read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisRecord instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisStringsResponse.java b/src/main/java/ai/reveng/model/AnalysisStringsResponse.java
index 3b2d9c1..7805e50 100644
--- a/src/main/java/ai/reveng/model/AnalysisStringsResponse.java
+++ b/src/main/java/ai/reveng/model/AnalysisStringsResponse.java
@@ -112,6 +112,50 @@ public void setTotalStrings(@javax.annotation.Nonnull Integer totalStrings) {
this.totalStrings = totalStrings;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisStringsResponse instance itself
+ */
+ public AnalysisStringsResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -124,12 +168,13 @@ public boolean equals(Object o) {
}
AnalysisStringsResponse analysisStringsResponse = (AnalysisStringsResponse) o;
return Objects.equals(this.strings, analysisStringsResponse.strings) &&
- Objects.equals(this.totalStrings, analysisStringsResponse.totalStrings);
+ Objects.equals(this.totalStrings, analysisStringsResponse.totalStrings)&&
+ Objects.equals(this.additionalProperties, analysisStringsResponse.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(strings, totalStrings);
+ return Objects.hash(strings, totalStrings, additionalProperties);
}
@Override
@@ -138,6 +183,7 @@ public String toString() {
sb.append("class AnalysisStringsResponse {\n");
sb.append(" strings: ").append(toIndentedString(strings)).append("\n");
sb.append(" totalStrings: ").append(toIndentedString(totalStrings)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -178,14 +224,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisStringsResponse.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisStringsResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisStringsResponse.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -220,6 +258,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisStringsResponse value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -227,7 +287,28 @@ public void write(JsonWriter out, AnalysisStringsResponse value) throws IOExcept
public AnalysisStringsResponse read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisStringsResponse instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisTags.java b/src/main/java/ai/reveng/model/AnalysisTags.java
index e88003b..796cf87 100644
--- a/src/main/java/ai/reveng/model/AnalysisTags.java
+++ b/src/main/java/ai/reveng/model/AnalysisTags.java
@@ -120,6 +120,50 @@ public void setSuggestedTags(@javax.annotation.Nonnull List additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisTags instance itself
+ */
+ public AnalysisTags putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -132,12 +176,13 @@ public boolean equals(Object o) {
}
AnalysisTags analysisTags = (AnalysisTags) o;
return Objects.equals(this.analysisTags, analysisTags.analysisTags) &&
- Objects.equals(this.suggestedTags, analysisTags.suggestedTags);
+ Objects.equals(this.suggestedTags, analysisTags.suggestedTags)&&
+ Objects.equals(this.additionalProperties, analysisTags.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(analysisTags, suggestedTags);
+ return Objects.hash(analysisTags, suggestedTags, additionalProperties);
}
@Override
@@ -146,6 +191,7 @@ public String toString() {
sb.append("class AnalysisTags {\n");
sb.append(" analysisTags: ").append(toIndentedString(analysisTags)).append("\n");
sb.append(" suggestedTags: ").append(toIndentedString(suggestedTags)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -186,14 +232,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisTags.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisTags` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisTags.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -238,6 +276,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisTags value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -245,7 +305,28 @@ public void write(JsonWriter out, AnalysisTags value) throws IOException {
public AnalysisTags read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisTags instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisUpdateRequest.java b/src/main/java/ai/reveng/model/AnalysisUpdateRequest.java
index c406944..c7bcc18 100644
--- a/src/main/java/ai/reveng/model/AnalysisUpdateRequest.java
+++ b/src/main/java/ai/reveng/model/AnalysisUpdateRequest.java
@@ -154,6 +154,50 @@ public void setAnalysisScope(@javax.annotation.Nullable AnalysisScopeEnum analys
this.analysisScope = analysisScope;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisUpdateRequest instance itself
+ */
+ public AnalysisUpdateRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -166,7 +210,8 @@ public boolean equals(Object o) {
}
AnalysisUpdateRequest analysisUpdateRequest = (AnalysisUpdateRequest) o;
return Objects.equals(this.binaryName, analysisUpdateRequest.binaryName) &&
- Objects.equals(this.analysisScope, analysisUpdateRequest.analysisScope);
+ Objects.equals(this.analysisScope, analysisUpdateRequest.analysisScope)&&
+ Objects.equals(this.additionalProperties, analysisUpdateRequest.additionalProperties);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
@@ -175,7 +220,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b)
@Override
public int hashCode() {
- return Objects.hash(binaryName, analysisScope);
+ return Objects.hash(binaryName, analysisScope, additionalProperties);
}
private static int hashCodeNullable(JsonNullable a) {
@@ -191,6 +236,7 @@ public String toString() {
sb.append("class AnalysisUpdateRequest {\n");
sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n");
sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -230,14 +276,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AnalysisUpdateRequest is not found in the empty JSON string", AnalysisUpdateRequest.openapiRequiredFields.toString()));
}
}
-
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisUpdateRequest.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("binary_name") != null && !jsonObj.get("binary_name").isJsonNull()) && !jsonObj.get("binary_name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString()));
@@ -266,6 +304,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisUpdateRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -273,7 +333,28 @@ public void write(JsonWriter out, AnalysisUpdateRequest value) throws IOExceptio
public AnalysisUpdateRequest read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisUpdateTagsRequest.java b/src/main/java/ai/reveng/model/AnalysisUpdateTagsRequest.java
index 60e66e9..1013099 100644
--- a/src/main/java/ai/reveng/model/AnalysisUpdateTagsRequest.java
+++ b/src/main/java/ai/reveng/model/AnalysisUpdateTagsRequest.java
@@ -87,6 +87,50 @@ public void setTags(@javax.annotation.Nonnull List tags) {
this.tags = tags;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisUpdateTagsRequest instance itself
+ */
+ public AnalysisUpdateTagsRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -98,12 +142,13 @@ public boolean equals(Object o) {
return false;
}
AnalysisUpdateTagsRequest analysisUpdateTagsRequest = (AnalysisUpdateTagsRequest) o;
- return Objects.equals(this.tags, analysisUpdateTagsRequest.tags);
+ return Objects.equals(this.tags, analysisUpdateTagsRequest.tags)&&
+ Objects.equals(this.additionalProperties, analysisUpdateTagsRequest.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(tags);
+ return Objects.hash(tags, additionalProperties);
}
@Override
@@ -111,6 +156,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnalysisUpdateTagsRequest {\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -151,14 +197,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisUpdateTagsRequest.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisUpdateTagsRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisUpdateTagsRequest.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -189,6 +227,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisUpdateTagsRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -196,7 +256,28 @@ public void write(JsonWriter out, AnalysisUpdateTagsRequest value) throws IOExce
public AnalysisUpdateTagsRequest read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisUpdateTagsRequest instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AnalysisUpdateTagsResponse.java b/src/main/java/ai/reveng/model/AnalysisUpdateTagsResponse.java
index 88470e0..deda6c6 100644
--- a/src/main/java/ai/reveng/model/AnalysisUpdateTagsResponse.java
+++ b/src/main/java/ai/reveng/model/AnalysisUpdateTagsResponse.java
@@ -88,6 +88,50 @@ public void setTags(@javax.annotation.Nonnull List tags) {
this.tags = tags;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AnalysisUpdateTagsResponse instance itself
+ */
+ public AnalysisUpdateTagsResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -99,12 +143,13 @@ public boolean equals(Object o) {
return false;
}
AnalysisUpdateTagsResponse analysisUpdateTagsResponse = (AnalysisUpdateTagsResponse) o;
- return Objects.equals(this.tags, analysisUpdateTagsResponse.tags);
+ return Objects.equals(this.tags, analysisUpdateTagsResponse.tags)&&
+ Objects.equals(this.additionalProperties, analysisUpdateTagsResponse.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(tags);
+ return Objects.hash(tags, additionalProperties);
}
@Override
@@ -112,6 +157,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnalysisUpdateTagsResponse {\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -152,14 +198,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AnalysisUpdateTagsResponse.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AnalysisUpdateTagsResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AnalysisUpdateTagsResponse.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -194,6 +232,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AnalysisUpdateTagsResponse value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -201,7 +261,28 @@ public void write(JsonWriter out, AnalysisUpdateTagsResponse value) throws IOExc
public AnalysisUpdateTagsResponse read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AnalysisUpdateTagsResponse instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AppApiRestV2AnalysesResponsesTagItem.java b/src/main/java/ai/reveng/model/AppApiRestV2AnalysesResponsesTagItem.java
index 794aac3..691844e 100644
--- a/src/main/java/ai/reveng/model/AppApiRestV2AnalysesResponsesTagItem.java
+++ b/src/main/java/ai/reveng/model/AppApiRestV2AnalysesResponsesTagItem.java
@@ -126,6 +126,50 @@ public void setCollectionId(@javax.annotation.Nullable Integer collectionId) {
this.collectionId = collectionId;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AppApiRestV2AnalysesResponsesTagItem instance itself
+ */
+ public AppApiRestV2AnalysesResponsesTagItem putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -139,7 +183,8 @@ public boolean equals(Object o) {
AppApiRestV2AnalysesResponsesTagItem appApiRestV2AnalysesResponsesTagItem = (AppApiRestV2AnalysesResponsesTagItem) o;
return Objects.equals(this.name, appApiRestV2AnalysesResponsesTagItem.name) &&
Objects.equals(this.origin, appApiRestV2AnalysesResponsesTagItem.origin) &&
- Objects.equals(this.collectionId, appApiRestV2AnalysesResponsesTagItem.collectionId);
+ Objects.equals(this.collectionId, appApiRestV2AnalysesResponsesTagItem.collectionId)&&
+ Objects.equals(this.additionalProperties, appApiRestV2AnalysesResponsesTagItem.additionalProperties);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
@@ -148,7 +193,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b)
@Override
public int hashCode() {
- return Objects.hash(name, origin, collectionId);
+ return Objects.hash(name, origin, collectionId, additionalProperties);
}
private static int hashCodeNullable(JsonNullable a) {
@@ -165,6 +210,7 @@ public String toString() {
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" origin: ").append(toIndentedString(origin)).append("\n");
sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -205,14 +251,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AppApiRestV2AnalysesResponsesTagItem.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AppApiRestV2AnalysesResponsesTagItem` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AppApiRestV2AnalysesResponsesTagItem.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -243,6 +281,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AppApiRestV2AnalysesResponsesTagItem value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -250,7 +310,28 @@ public void write(JsonWriter out, AppApiRestV2AnalysesResponsesTagItem value) th
public AppApiRestV2AnalysesResponsesTagItem read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AppApiRestV2AnalysesResponsesTagItem instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsResponsesFunction.java b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsResponsesFunction.java
index c13c8af..7468928 100644
--- a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsResponsesFunction.java
+++ b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsResponsesFunction.java
@@ -21,6 +21,7 @@
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Arrays;
+import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -53,7 +54,7 @@
public class AppApiRestV2FunctionsResponsesFunction {
public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id";
@SerializedName(SERIALIZED_NAME_FUNCTION_ID)
- @javax.annotation.Nonnull
+ @javax.annotation.Nullable
private Integer functionId;
public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr";
@@ -64,7 +65,7 @@ public class AppApiRestV2FunctionsResponsesFunction {
public AppApiRestV2FunctionsResponsesFunction() {
}
- public AppApiRestV2FunctionsResponsesFunction functionId(@javax.annotation.Nonnull Integer functionId) {
+ public AppApiRestV2FunctionsResponsesFunction functionId(@javax.annotation.Nullable Integer functionId) {
this.functionId = functionId;
return this;
}
@@ -73,12 +74,12 @@ public AppApiRestV2FunctionsResponsesFunction functionId(@javax.annotation.Nonnu
* Get functionId
* @return functionId
*/
- @javax.annotation.Nonnull
+ @javax.annotation.Nullable
public Integer getFunctionId() {
return functionId;
}
- public void setFunctionId(@javax.annotation.Nonnull Integer functionId) {
+ public void setFunctionId(@javax.annotation.Nullable Integer functionId) {
this.functionId = functionId;
}
@@ -101,6 +102,50 @@ public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) {
this.functionVaddr = functionVaddr;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AppApiRestV2FunctionsResponsesFunction instance itself
+ */
+ public AppApiRestV2FunctionsResponsesFunction putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -113,12 +158,24 @@ public boolean equals(Object o) {
}
AppApiRestV2FunctionsResponsesFunction appApiRestV2FunctionsResponsesFunction = (AppApiRestV2FunctionsResponsesFunction) o;
return Objects.equals(this.functionId, appApiRestV2FunctionsResponsesFunction.functionId) &&
- Objects.equals(this.functionVaddr, appApiRestV2FunctionsResponsesFunction.functionVaddr);
+ Objects.equals(this.functionVaddr, appApiRestV2FunctionsResponsesFunction.functionVaddr)&&
+ Objects.equals(this.additionalProperties, appApiRestV2FunctionsResponsesFunction.additionalProperties);
+ }
+
+ private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
+ return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
- return Objects.hash(functionId, functionVaddr);
+ return Objects.hash(functionId, functionVaddr, additionalProperties);
+ }
+
+ private static int hashCodeNullable(JsonNullable a) {
+ if (a == null) {
+ return 1;
+ }
+ return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
@@ -127,6 +184,7 @@ public String toString() {
sb.append("class AppApiRestV2FunctionsResponsesFunction {\n");
sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n");
sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -151,7 +209,7 @@ private String toIndentedString(Object o) {
openapiFields = new HashSet(Arrays.asList("function_id", "function_vaddr"));
// a set of required properties/fields (JSON key names)
- openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_vaddr"));
+ openapiRequiredFields = new HashSet(Arrays.asList("function_vaddr"));
}
/**
@@ -167,14 +225,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AppApiRestV2FunctionsResponsesFunction.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AppApiRestV2FunctionsResponsesFunction` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AppApiRestV2FunctionsResponsesFunction.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -199,6 +249,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AppApiRestV2FunctionsResponsesFunction value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -206,7 +278,28 @@ public void write(JsonWriter out, AppApiRestV2FunctionsResponsesFunction value)
public AppApiRestV2FunctionsResponsesFunction read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AppApiRestV2FunctionsResponsesFunction instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java
index f5a36e4..748b853 100644
--- a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java
+++ b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java
@@ -264,6 +264,50 @@ public void setEmbedding1d(@javax.annotation.Nullable List embedding
this.embedding1d = embedding1d;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AppApiRestV2FunctionsTypesFunction instance itself
+ */
+ public AppApiRestV2FunctionsTypesFunction putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -282,12 +326,13 @@ public boolean equals(Object o) {
Objects.equals(this.functionSize, appApiRestV2FunctionsTypesFunction.functionSize) &&
Objects.equals(this.debug, appApiRestV2FunctionsTypesFunction.debug) &&
Objects.equals(this.embedding3d, appApiRestV2FunctionsTypesFunction.embedding3d) &&
- Objects.equals(this.embedding1d, appApiRestV2FunctionsTypesFunction.embedding1d);
+ Objects.equals(this.embedding1d, appApiRestV2FunctionsTypesFunction.embedding1d)&&
+ Objects.equals(this.additionalProperties, appApiRestV2FunctionsTypesFunction.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(functionId, functionName, functionMangledName, functionVaddr, functionSize, debug, embedding3d, embedding1d);
+ return Objects.hash(functionId, functionName, functionMangledName, functionVaddr, functionSize, debug, embedding3d, embedding1d, additionalProperties);
}
@Override
@@ -302,6 +347,7 @@ public String toString() {
sb.append(" debug: ").append(toIndentedString(debug)).append("\n");
sb.append(" embedding3d: ").append(toIndentedString(embedding3d)).append("\n");
sb.append(" embedding1d: ").append(toIndentedString(embedding1d)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -342,14 +388,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AppApiRestV2FunctionsTypesFunction.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AppApiRestV2FunctionsTypesFunction` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AppApiRestV2FunctionsTypesFunction.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -392,6 +430,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AppApiRestV2FunctionsTypesFunction value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -399,7 +459,28 @@ public void write(JsonWriter out, AppApiRestV2FunctionsTypesFunction value) thro
public AppApiRestV2FunctionsTypesFunction read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AppApiRestV2FunctionsTypesFunction instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/ai/reveng/model/AppServicesBinaryAnnSchemaTagItem.java b/src/main/java/ai/reveng/model/AppServicesBinaryAnnSchemaTagItem.java
index 19652e1..9c2245d 100644
--- a/src/main/java/ai/reveng/model/AppServicesBinaryAnnSchemaTagItem.java
+++ b/src/main/java/ai/reveng/model/AppServicesBinaryAnnSchemaTagItem.java
@@ -102,6 +102,50 @@ public void setOrigin(@javax.annotation.Nullable String origin) {
this.origin = origin;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AppServicesBinaryAnnSchemaTagItem instance itself
+ */
+ public AppServicesBinaryAnnSchemaTagItem putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -114,7 +158,8 @@ public boolean equals(Object o) {
}
AppServicesBinaryAnnSchemaTagItem appServicesBinaryAnnSchemaTagItem = (AppServicesBinaryAnnSchemaTagItem) o;
return Objects.equals(this.tag, appServicesBinaryAnnSchemaTagItem.tag) &&
- Objects.equals(this.origin, appServicesBinaryAnnSchemaTagItem.origin);
+ Objects.equals(this.origin, appServicesBinaryAnnSchemaTagItem.origin)&&
+ Objects.equals(this.additionalProperties, appServicesBinaryAnnSchemaTagItem.additionalProperties);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
@@ -123,7 +168,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b)
@Override
public int hashCode() {
- return Objects.hash(tag, origin);
+ return Objects.hash(tag, origin, additionalProperties);
}
private static int hashCodeNullable(JsonNullable a) {
@@ -139,6 +184,7 @@ public String toString() {
sb.append("class AppServicesBinaryAnnSchemaTagItem {\n");
sb.append(" tag: ").append(toIndentedString(tag)).append("\n");
sb.append(" origin: ").append(toIndentedString(origin)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -178,14 +224,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in AppServicesBinaryAnnSchemaTagItem is not found in the empty JSON string", AppServicesBinaryAnnSchemaTagItem.openapiRequiredFields.toString()));
}
}
-
- Set