@@ -108,7 +113,7 @@
- ${project.basedir}/src/main/resources/sodastore.json
+ ${project.basedir}/src/main/resources/sodastore.yaml
com.sap.cloud.sdk.datamodel.openapi.sample.api
com.sap.cloud.sdk.datamodel.openapi.sample.model
released
@@ -119,6 +124,7 @@
create
protected
+ true
true
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/api/SodasApi.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/api/SodasApi.java
index adbe72a0e..ebf06d60d 100644
--- a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/api/SodasApi.java
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/api/SodasApi.java
@@ -178,9 +178,9 @@ public SodaWithId sodasIdGet( @Nonnull final Long id )
*
* 200 - The updated soda product
*
- * 404 - Soda product not found
- *
* 204 - Nothing has changed
+ *
+ * 404 - Soda product not found
*
* @param sodaWithId
* The updated soda product
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/AllOf.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/AllOf.java
new file mode 100644
index 000000000..67884d8a2
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/AllOf.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * SodaStore API
+ * API for managing soda products and orders in SodaStore.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.datamodel.openapi.sample.model;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * AllOf
+ */
+// CHECKSTYLE:OFF
+public class AllOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty( "sodaType" )
+ private String sodaType;
+
+ @JsonProperty( "caffeine" )
+ private Boolean caffeine;
+
+ @JsonProperty( "color" )
+ private String color;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Default constructor for AllOf.
+ */
+ protected AllOf()
+ {
+ }
+
+ /**
+ * Set the sodaType of this {@link AllOf} instance and return the same instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link AllOf}
+ * @return The same instance of this {@link AllOf} class
+ */
+ @Nonnull
+ public AllOf sodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ *
+ * @return sodaType The sodaType of this {@link AllOf} instance.
+ */
+ @Nonnull
+ public String getSodaType()
+ {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link AllOf} instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link AllOf}
+ */
+ public void setSodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Set the caffeine of this {@link AllOf} instance and return the same instance.
+ *
+ * @param caffeine
+ * The caffeine of this {@link AllOf}
+ * @return The same instance of this {@link AllOf} class
+ */
+ @Nonnull
+ public AllOf caffeine( @Nullable final Boolean caffeine )
+ {
+ this.caffeine = caffeine;
+ return this;
+ }
+
+ /**
+ * Get caffeine
+ *
+ * @return caffeine The caffeine of this {@link AllOf} instance.
+ */
+ @Nonnull
+ public Boolean isCaffeine()
+ {
+ return caffeine;
+ }
+
+ /**
+ * Set the caffeine of this {@link AllOf} instance.
+ *
+ * @param caffeine
+ * The caffeine of this {@link AllOf}
+ */
+ public void setCaffeine( @Nullable final Boolean caffeine )
+ {
+ this.caffeine = caffeine;
+ }
+
+ /**
+ * Set the color of this {@link AllOf} instance and return the same instance.
+ *
+ * @param color
+ * The color of this {@link AllOf}
+ * @return The same instance of this {@link AllOf} class
+ */
+ @Nonnull
+ public AllOf color( @Nullable final String color )
+ {
+ this.color = color;
+ return this;
+ }
+
+ /**
+ * Get color
+ *
+ * @return color The color of this {@link AllOf} instance.
+ */
+ @Nonnull
+ public String getColor()
+ {
+ return color;
+ }
+
+ /**
+ * Set the color of this {@link AllOf} instance.
+ *
+ * @param color
+ * The color of this {@link AllOf}
+ */
+ public void setColor( @Nullable final String color )
+ {
+ this.color = color;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link AllOf}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames()
+ {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link AllOf} instance.
+ *
+ * @param name
+ * The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException
+ * If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name )
+ throws NoSuchElementException
+ {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("AllOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained a mapping for the
+ * key, the old value is replaced by the specified value.
+ *
+ * @param customFieldName
+ * The name of the property
+ * @param customFieldValue
+ * The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+ @Override
+ public boolean equals( @Nullable final java.lang.Object o )
+ {
+ if( this == o ) {
+ return true;
+ }
+ if( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+ final AllOf allOf = (AllOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields)
+ && Objects.equals(this.sodaType, allOf.sodaType)
+ && Objects.equals(this.caffeine, allOf.caffeine)
+ && Objects.equals(this.color, allOf.color);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return Objects.hash(sodaType, caffeine, color, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class AllOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n");
+ sb.append(" color: ").append(toIndentedString(color)).append("\n");
+ cloudSdkCustomFields
+ .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString( final java.lang.Object o )
+ {
+ if( o == null ) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ /**
+ * Create a new {@link AllOf} instance. No arguments are required.
+ */
+ public static AllOf create()
+ {
+ return new AllOf();
+ }
+
+}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/AnyOf.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/AnyOf.java
new file mode 100644
index 000000000..5c40e1e68
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/AnyOf.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * SodaStore API
+ * API for managing soda products and orders in SodaStore.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.datamodel.openapi.sample.model;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * AnyOf
+ */
+// CHECKSTYLE:OFF
+public class AnyOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty( "sodaType" )
+ private String sodaType;
+
+ @JsonProperty( "caffeine" )
+ private Boolean caffeine;
+
+ @JsonProperty( "color" )
+ private String color;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Default constructor for AnyOf.
+ */
+ protected AnyOf()
+ {
+ }
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance and return the same instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link AnyOf}
+ * @return The same instance of this {@link AnyOf} class
+ */
+ @Nonnull
+ public AnyOf sodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ *
+ * @return sodaType The sodaType of this {@link AnyOf} instance.
+ */
+ @Nonnull
+ public String getSodaType()
+ {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link AnyOf}
+ */
+ public void setSodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Set the caffeine of this {@link AnyOf} instance and return the same instance.
+ *
+ * @param caffeine
+ * The caffeine of this {@link AnyOf}
+ * @return The same instance of this {@link AnyOf} class
+ */
+ @Nonnull
+ public AnyOf caffeine( @Nullable final Boolean caffeine )
+ {
+ this.caffeine = caffeine;
+ return this;
+ }
+
+ /**
+ * Get caffeine
+ *
+ * @return caffeine The caffeine of this {@link AnyOf} instance.
+ */
+ @Nonnull
+ public Boolean isCaffeine()
+ {
+ return caffeine;
+ }
+
+ /**
+ * Set the caffeine of this {@link AnyOf} instance.
+ *
+ * @param caffeine
+ * The caffeine of this {@link AnyOf}
+ */
+ public void setCaffeine( @Nullable final Boolean caffeine )
+ {
+ this.caffeine = caffeine;
+ }
+
+ /**
+ * Set the color of this {@link AnyOf} instance and return the same instance.
+ *
+ * @param color
+ * The color of this {@link AnyOf}
+ * @return The same instance of this {@link AnyOf} class
+ */
+ @Nonnull
+ public AnyOf color( @Nullable final String color )
+ {
+ this.color = color;
+ return this;
+ }
+
+ /**
+ * Get color
+ *
+ * @return color The color of this {@link AnyOf} instance.
+ */
+ @Nonnull
+ public String getColor()
+ {
+ return color;
+ }
+
+ /**
+ * Set the color of this {@link AnyOf} instance.
+ *
+ * @param color
+ * The color of this {@link AnyOf}
+ */
+ public void setColor( @Nullable final String color )
+ {
+ this.color = color;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link AnyOf}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames()
+ {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link AnyOf} instance.
+ *
+ * @param name
+ * The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException
+ * If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name )
+ throws NoSuchElementException
+ {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("AnyOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained a mapping for the
+ * key, the old value is replaced by the specified value.
+ *
+ * @param customFieldName
+ * The name of the property
+ * @param customFieldValue
+ * The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+ @Override
+ public boolean equals( @Nullable final java.lang.Object o )
+ {
+ if( this == o ) {
+ return true;
+ }
+ if( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+ final AnyOf anyOf = (AnyOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields)
+ && Objects.equals(this.sodaType, anyOf.sodaType)
+ && Objects.equals(this.caffeine, anyOf.caffeine)
+ && Objects.equals(this.color, anyOf.color);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return Objects.hash(sodaType, caffeine, color, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class AnyOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n");
+ sb.append(" color: ").append(toIndentedString(color)).append("\n");
+ cloudSdkCustomFields
+ .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString( final java.lang.Object o )
+ {
+ if( o == null ) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ /**
+ * Create a new {@link AnyOf} instance. No arguments are required.
+ */
+ public static AnyOf create()
+ {
+ return new AnyOf();
+ }
+
+}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Cola.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Cola.java
new file mode 100644
index 000000000..80cab38dd
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Cola.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * SodaStore API
+ * API for managing soda products and orders in SodaStore.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.datamodel.openapi.sample.model;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Cola
+ */
+// CHECKSTYLE:OFF
+public class Cola implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping
+// CHECKSTYLE:ON
+{
+ @JsonProperty( "sodaType" )
+ private String sodaType;
+
+ @JsonProperty( "caffeine" )
+ private Boolean caffeine;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Default constructor for Cola.
+ */
+ protected Cola()
+ {
+ }
+
+ /**
+ * Set the sodaType of this {@link Cola} instance and return the same instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link Cola}
+ * @return The same instance of this {@link Cola} class
+ */
+ @Nonnull
+ public Cola sodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ *
+ * @return sodaType The sodaType of this {@link Cola} instance.
+ */
+ @Nonnull
+ public String getSodaType()
+ {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Cola} instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link Cola}
+ */
+ public void setSodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Set the caffeine of this {@link Cola} instance and return the same instance.
+ *
+ * @param caffeine
+ * The caffeine of this {@link Cola}
+ * @return The same instance of this {@link Cola} class
+ */
+ @Nonnull
+ public Cola caffeine( @Nullable final Boolean caffeine )
+ {
+ this.caffeine = caffeine;
+ return this;
+ }
+
+ /**
+ * Get caffeine
+ *
+ * @return caffeine The caffeine of this {@link Cola} instance.
+ */
+ @Nonnull
+ public Boolean isCaffeine()
+ {
+ return caffeine;
+ }
+
+ /**
+ * Set the caffeine of this {@link Cola} instance.
+ *
+ * @param caffeine
+ * The caffeine of this {@link Cola}
+ */
+ public void setCaffeine( @Nullable final Boolean caffeine )
+ {
+ this.caffeine = caffeine;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Cola}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames()
+ {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Cola} instance.
+ *
+ * @param name
+ * The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException
+ * If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name )
+ throws NoSuchElementException
+ {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Cola has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a mapping for the
+ * key, the old value is replaced by the specified value.
+ *
+ * @param customFieldName
+ * The name of the property
+ * @param customFieldValue
+ * The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+ @Override
+ public boolean equals( @Nullable final java.lang.Object o )
+ {
+ if( this == o ) {
+ return true;
+ }
+ if( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+ final Cola cola = (Cola) o;
+ return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields)
+ && Objects.equals(this.sodaType, cola.sodaType)
+ && Objects.equals(this.caffeine, cola.caffeine);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return Objects.hash(sodaType, caffeine, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Cola {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n");
+ cloudSdkCustomFields
+ .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString( final java.lang.Object o )
+ {
+ if( o == null ) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ /**
+ * Create a new {@link Cola} instance. No arguments are required.
+ */
+ public static Cola create()
+ {
+ return new Cola();
+ }
+
+}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Fanta.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Fanta.java
new file mode 100644
index 000000000..5a14ed75b
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Fanta.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * SodaStore API
+ * API for managing soda products and orders in SodaStore.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.datamodel.openapi.sample.model;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Fanta
+ */
+// CHECKSTYLE:OFF
+public class Fanta implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping
+// CHECKSTYLE:ON
+{
+ @JsonProperty( "sodaType" )
+ private String sodaType;
+
+ @JsonProperty( "color" )
+ private String color;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Default constructor for Fanta.
+ */
+ protected Fanta()
+ {
+ }
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance and return the same instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link Fanta}
+ * @return The same instance of this {@link Fanta} class
+ */
+ @Nonnull
+ public Fanta sodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ *
+ * @return sodaType The sodaType of this {@link Fanta} instance.
+ */
+ @Nonnull
+ public String getSodaType()
+ {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance.
+ *
+ * @param sodaType
+ * The sodaType of this {@link Fanta}
+ */
+ public void setSodaType( @Nullable final String sodaType )
+ {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Set the color of this {@link Fanta} instance and return the same instance.
+ *
+ * @param color
+ * The color of this {@link Fanta}
+ * @return The same instance of this {@link Fanta} class
+ */
+ @Nonnull
+ public Fanta color( @Nullable final String color )
+ {
+ this.color = color;
+ return this;
+ }
+
+ /**
+ * Get color
+ *
+ * @return color The color of this {@link Fanta} instance.
+ */
+ @Nonnull
+ public String getColor()
+ {
+ return color;
+ }
+
+ /**
+ * Set the color of this {@link Fanta} instance.
+ *
+ * @param color
+ * The color of this {@link Fanta}
+ */
+ public void setColor( @Nullable final String color )
+ {
+ this.color = color;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Fanta}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames()
+ {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Fanta} instance.
+ *
+ * @param name
+ * The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException
+ * If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name )
+ throws NoSuchElementException
+ {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Fanta has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained a mapping for the
+ * key, the old value is replaced by the specified value.
+ *
+ * @param customFieldName
+ * The name of the property
+ * @param customFieldValue
+ * The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+ @Override
+ public boolean equals( @Nullable final java.lang.Object o )
+ {
+ if( this == o ) {
+ return true;
+ }
+ if( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+ final Fanta fanta = (Fanta) o;
+ return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields)
+ && Objects.equals(this.sodaType, fanta.sodaType)
+ && Objects.equals(this.color, fanta.color);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return Objects.hash(sodaType, color, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Fanta {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ sb.append(" color: ").append(toIndentedString(color)).append("\n");
+ cloudSdkCustomFields
+ .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString( final java.lang.Object o )
+ {
+ if( o == null ) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ /**
+ * Create a new {@link Fanta} instance. No arguments are required.
+ */
+ public static Fanta create()
+ {
+ return new Fanta();
+ }
+
+}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOf.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOf.java
new file mode 100644
index 000000000..47e69617e
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOf.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * SodaStore API
+ * API for managing soda products and orders in SodaStore.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.datamodel.openapi.sample.model;
+
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+/**
+ * OneOf
+ */
+@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION )
+@JsonSubTypes( { @JsonSubTypes.Type( value = Cola.class ), @JsonSubTypes.Type( value = Fanta.class ), } )
+
+public interface OneOf
+{
+}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOfWithDiscriminator.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOfWithDiscriminator.java
new file mode 100644
index 000000000..9c31dbc7a
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOfWithDiscriminator.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * SodaStore API
+ * API for managing soda products and orders in SodaStore.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.datamodel.openapi.sample.model;
+
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+/**
+ * OneOfWithDiscriminator
+ */
+@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true )
+@JsonSubTypes( {
+ @JsonSubTypes.Type( value = Cola.class, name = "Cola" ),
+ @JsonSubTypes.Type( value = Fanta.class, name = "Fanta" ), } )
+
+public interface OneOfWithDiscriminator
+{
+ String getSodaType();
+}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java
new file mode 100644
index 000000000..987be2d11
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * SodaStore API
+ * API for managing soda products and orders in SodaStore.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.datamodel.openapi.sample.model;
+
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+/**
+ * OneOfWithDiscriminatorAndMapping
+ */
+@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true )
+@JsonSubTypes( {
+ @JsonSubTypes.Type( value = Cola.class, name = "cool_cola" ),
+ @JsonSubTypes.Type( value = Fanta.class, name = "fancy_fanta" ),
+ @JsonSubTypes.Type( value = Cola.class, name = "Cola" ),
+ @JsonSubTypes.Type( value = Fanta.class, name = "Fanta" ), } )
+
+public interface OneOfWithDiscriminatorAndMapping
+{
+ String getSodaType();
+}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Order.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Order.java
index 8f73cef29..3faac6654 100644
--- a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Order.java
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Order.java
@@ -56,6 +56,9 @@ public class Order
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+ /**
+ * Default constructor for Order.
+ */
protected Order()
{
}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OrderWithTimestamp.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OrderWithTimestamp.java
index b0ff17115..7c44c844a 100644
--- a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OrderWithTimestamp.java
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/OrderWithTimestamp.java
@@ -60,6 +60,9 @@ public class OrderWithTimestamp
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+ /**
+ * Default constructor for OrderWithTimestamp.
+ */
protected OrderWithTimestamp()
{
}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Soda.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Soda.java
index 3cef9af06..41b756de7 100644
--- a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Soda.java
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/Soda.java
@@ -134,6 +134,9 @@ public static PackagingEnum fromValue( @Nonnull final String value )
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+ /**
+ * Default constructor for Soda.
+ */
protected Soda()
{
}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/SodaWithId.java b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/SodaWithId.java
index 9d9731fb5..2f4ef17c1 100644
--- a/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/SodaWithId.java
+++ b/datamodel/openapi/openapi-api-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/sample/model/SodaWithId.java
@@ -137,6 +137,9 @@ public static PackagingEnum fromValue( @Nonnull final String value )
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+ /**
+ * Default constructor for SodaWithId.
+ */
protected SodaWithId()
{
}
diff --git a/datamodel/openapi/openapi-api-sample/src/main/resources/sodastore.yaml b/datamodel/openapi/openapi-api-sample/src/main/resources/sodastore.yaml
new file mode 100644
index 000000000..286817bc2
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/main/resources/sodastore.yaml
@@ -0,0 +1,224 @@
+openapi: 3.0.3
+info:
+ title: SodaStore API
+ version: 1.0.0
+ description: API for managing soda products and orders in SodaStore.
+tags:
+ - name: Sodas
+ description: Everything about our Sodas
+ - name: user
+ description: Operations about user
+ - name: Orders
+ description: Access to Sodastore orders
+components:
+ securitySchemes:
+ apiKeyAuth:
+ type: apiKey
+ in: header
+ name: X-API-Key
+ bearerAuth:
+ type: http
+ scheme: bearer
+ schemas:
+ Soda:
+ type: object
+ required:
+ - name
+ - brand
+ - quantity
+ - price
+ properties:
+ name:
+ type: string
+ example: Cola
+ brand:
+ type: string
+ example: Coca-Cola
+ quantity:
+ type: integer
+ format: int32
+ example: 100
+ packaging:
+ type: string
+ enum:
+ - glass
+ - carton
+ - can
+ nullable: false
+ price:
+ type: number
+ format: float
+ example: 1.5
+ SodaWithId:
+ allOf:
+ - $ref: '#/components/schemas/Soda'
+ - type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ example: 123
+ Order:
+ type: object
+ required:
+ - productId
+ - quantity
+ properties:
+ productId:
+ type: integer
+ format: int64
+ example: 1
+ quantity:
+ type: integer
+ format: int32
+ example: 2
+ totalPrice:
+ type: number
+ format: float
+ example: 3
+ typelessProperty:
+ description: >-
+ Some typeless property, interpreted by the generator as nullable by
+ default (because typeless)
+ nullableProperty:
+ type: string
+ description: Some typed property that is deliberately made nullable
+ nullable: true
+ OrderWithTimestamp:
+ allOf:
+ - $ref: '#/components/schemas/Order'
+ - type: object
+ properties:
+ timestamp:
+ type: string
+ format: date-time
+ OneOfWithDiscriminatorAndMapping:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ mapping:
+ cool_cola: '#/components/schemas/Cola'
+ fancy_fanta: '#/components/schemas/Fanta'
+ OneOfWithDiscriminator:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ OneOf:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AnyOf:
+ anyOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AllOf:
+ allOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ Cola:
+ type: object
+ properties:
+ sodaType:
+ type: string
+ caffeine:
+ type: boolean
+ Fanta:
+ type: object
+ properties:
+ sodaType:
+ type: string
+ color:
+ type: string
+paths:
+ /sodas:
+ get:
+ summary: Get all soda products
+ tags:
+ - Sodas
+ security:
+ - apiKeyAuth: []
+ responses:
+ '200':
+ description: A list of soda products
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SodaWithId'
+ put:
+ summary: Update a specific soda product by ID
+ tags:
+ - Sodas
+ security:
+ - apiKeyAuth: []
+ requestBody:
+ description: The updated soda product
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SodaWithId'
+ responses:
+ '200':
+ description: The updated soda product
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Soda'
+ '204':
+ description: Nothing has changed
+ '404':
+ description: Soda product not found
+ /sodas/{id}:
+ get:
+ summary: Get a specific soda product by ID
+ tags:
+ - Sodas
+ security:
+ - apiKeyAuth: []
+ parameters:
+ - name: id
+ in: path
+ description: ID of the soda product to retrieve
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ '200':
+ description: The soda product
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SodaWithId'
+ '404':
+ description: Soda product not found
+ /orders:
+ post:
+ summary: Create a new order
+ tags:
+ - Orders
+ security:
+ - apiKeyAuth: []
+ requestBody:
+ description: The order details
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ responses:
+ '201':
+ description: The created order
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+security:
+ - apiKeyAuth: []
+ - bearerAuth: []
diff --git a/datamodel/openapi/openapi-api-sample/src/test/java/com/sap/cloud/sdk/datamodel/openapi/sample/api/OneOfDeserializationTest.java b/datamodel/openapi/openapi-api-sample/src/test/java/com/sap/cloud/sdk/datamodel/openapi/sample/api/OneOfDeserializationTest.java
new file mode 100644
index 000000000..011356a3b
--- /dev/null
+++ b/datamodel/openapi/openapi-api-sample/src/test/java/com/sap/cloud/sdk/datamodel/openapi/sample/api/OneOfDeserializationTest.java
@@ -0,0 +1,183 @@
+package com.sap.cloud.sdk.datamodel.openapi.sample.api;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+
+import javax.annotation.Nonnull;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import com.sap.cloud.sdk.datamodel.openapi.sample.model.AllOf;
+import com.sap.cloud.sdk.datamodel.openapi.sample.model.AnyOf;
+import com.sap.cloud.sdk.datamodel.openapi.sample.model.Cola;
+import com.sap.cloud.sdk.datamodel.openapi.sample.model.Fanta;
+import com.sap.cloud.sdk.datamodel.openapi.sample.model.OneOf;
+import com.sap.cloud.sdk.datamodel.openapi.sample.model.OneOfWithDiscriminator;
+import com.sap.cloud.sdk.datamodel.openapi.sample.model.OneOfWithDiscriminatorAndMapping;
+
+class OneOfDeserializationTest
+{
+ private static final ObjectMapper objectMapper = newDefaultObjectMapper();
+
+ private static final Cola COLA_OBJECT = Cola.create().caffeine(true).sodaType("Cola");
+ private static final Fanta FANTA_OBJECT = Fanta.create().color("orange").sodaType("Fanta");
+ private static final String COLA_JSON = """
+ {
+ "sodaType": "Cola",
+ "caffeine": true
+ }""";
+ private static final String FANTA_JSON = """
+ {
+ "sodaType": "Fanta",
+ "color": "orange"
+ }""";
+ private static final String UNKNOWN_JSON = """
+ {
+ "sodaType": "Sprite",
+ "someProperty": "someValue"
+ }""";
+
+ @Test
+ void oneOf()
+ throws JsonProcessingException
+ {
+ var actual = objectMapper.readValue(COLA_JSON, OneOf.class);
+ assertThat(actual)
+ .describedAs("Object should automatically be deserialized as Cola with JSON subtype deduction")
+ .isInstanceOf(Cola.class)
+ .isEqualTo(COLA_OBJECT);
+
+ actual = objectMapper.readValue(FANTA_JSON, OneOf.class);
+ assertThat(actual)
+ .describedAs("Object should automatically be deserialized as Fanta with JSON subtype deduction")
+ .isInstanceOf(Fanta.class)
+ .isEqualTo(FANTA_OBJECT);
+
+ assertThatThrownBy(() -> objectMapper.readValue(UNKNOWN_JSON, OneOf.class))
+ .isInstanceOf(JsonProcessingException.class);
+ }
+
+ @Test
+ void oneOfWithDiscriminator()
+ throws JsonProcessingException
+ {
+ var actual = objectMapper.readValue(COLA_JSON, OneOfWithDiscriminator.class);
+ assertThat(actual)
+ .describedAs(
+ "Object should automatically be deserialized as Cola using the class names as discriminator mapping values")
+ .isInstanceOf(Cola.class)
+ .isEqualTo(COLA_OBJECT);
+
+ actual = objectMapper.readValue(FANTA_JSON, OneOfWithDiscriminator.class);
+ assertThat(actual)
+ .describedAs(
+ "Object should automatically be deserialized as Fanta using the class names as discriminator mapping values")
+ .isInstanceOf(Fanta.class)
+ .isEqualTo(FANTA_OBJECT);
+
+ assertThatThrownBy(() -> objectMapper.readValue(UNKNOWN_JSON, OneOfWithDiscriminator.class));
+ }
+
+ @Test
+ void oneOfWithDiscriminatorAndMapping()
+ throws JsonProcessingException
+ {
+ var jsonWithCustomMapping = """
+ {
+ "sodaType": "cool_cola",
+ "caffeine": true
+ }""";
+ var actual = objectMapper.readValue(jsonWithCustomMapping, OneOfWithDiscriminatorAndMapping.class);
+ assertThat(actual)
+ .describedAs(
+ "Object should automatically be deserialized as Cola using the explicit discriminator mapping values")
+ .isInstanceOf(Cola.class)
+ .isEqualTo(Cola.create().caffeine(true).sodaType("cool_cola"));
+
+ jsonWithCustomMapping = """
+ {
+ "sodaType": "fancy_fanta",
+ "color": "orange"
+ }""";
+ actual = objectMapper.readValue(jsonWithCustomMapping, OneOfWithDiscriminatorAndMapping.class);
+ assertThat(actual)
+ .describedAs(
+ "Object should automatically be deserialized as Fanta using the explicit discriminator mapping values")
+ .isInstanceOf(Fanta.class)
+ .isEqualTo(Fanta.create().color("orange").sodaType("fancy_fanta"));
+
+ assertThatThrownBy(() -> objectMapper.readValue(UNKNOWN_JSON, OneOfWithDiscriminatorAndMapping.class))
+ .isInstanceOf(JsonProcessingException.class);
+
+ }
+
+ @Test
+ void anyOf()
+ throws JsonProcessingException
+ {
+ AnyOf anyOfCola = objectMapper.readValue(COLA_JSON, AnyOf.class);
+ assertThat(anyOfCola.getSodaType()).isEqualTo("Cola");
+ assertThat(anyOfCola.isCaffeine()).isTrue();
+ assertThat(anyOfCola.getColor()).isNull();
+
+ AnyOf anyOfFanta = objectMapper.readValue(FANTA_JSON, AnyOf.class);
+ assertThat(anyOfFanta.getSodaType()).isEqualTo("Fanta");
+ assertThat(anyOfFanta.getColor()).isEqualTo("orange");
+ assertThat(anyOfFanta.isCaffeine()).isNull();
+ }
+
+ @Test
+ void allOf()
+ throws JsonProcessingException
+ {
+ AllOf allOfCola = objectMapper.readValue(COLA_JSON, AllOf.class);
+ assertThat(allOfCola.getSodaType()).isEqualTo("Cola");
+ assertThat(allOfCola.isCaffeine()).isTrue();
+ assertThat(allOfCola.getColor()).isNull();
+
+ AllOf allOfFanta = objectMapper.readValue(FANTA_JSON, AllOf.class);
+ assertThat(allOfFanta.getSodaType()).isEqualTo("Fanta");
+ assertThat(allOfFanta.getColor()).isEqualTo("orange");
+ assertThat(allOfFanta.isCaffeine()).isNull();
+ }
+
+ @Test
+ void testColaSerialization()
+ throws JsonProcessingException
+ {
+ var expected = objectMapper.readValue(COLA_JSON, JsonNode.class);
+ var actual = objectMapper.valueToTree(expected);
+
+ assertThat(actual).isEqualTo(expected);
+ }
+
+ @Test
+ void testFantaSerialization()
+ throws JsonProcessingException
+ {
+ var expected = objectMapper.readValue(FANTA_JSON, JsonNode.class);
+ var actual = objectMapper.valueToTree(expected);
+
+ assertThat(actual).isEqualTo(expected);
+ }
+
+ /**
+ * Taken from {@link com.sap.cloud.sdk.services.openapi.apiclient.ApiClient}
+ */
+ @Nonnull
+ private static ObjectMapper newDefaultObjectMapper()
+ {
+ return new Jackson2ObjectMapperBuilder()
+ .modules(new JavaTimeModule())
+ .visibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE)
+ .visibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.NONE)
+ .build();
+ }
+}
diff --git a/datamodel/openapi/openapi-core/pom.xml b/datamodel/openapi/openapi-core/pom.xml
index 7ccfa3659..2b8fd93d5 100644
--- a/datamodel/openapi/openapi-core/pom.xml
+++ b/datamodel/openapi/openapi-core/pom.xml
@@ -4,7 +4,7 @@
com.sap.cloud.sdk.datamodel
openapi-parent
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
openapi-core
Data Model - OpenAPI Services - Core
diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClient.java
index 49e691979..d99849374 100644
--- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClient.java
+++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClient.java
@@ -693,6 +693,7 @@ public T invokeAPI(
// auth headers are added automatically by the SDK
// updateParamsForAuth(authNames, queryParams, headerParams);
+ @SuppressWarnings( "deprecation" ) // spring-web:6.2.0 and later, works until <7.0.0
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
if( queryParams != null ) {
//encode the query parameters in case they contain unsafe characters
diff --git a/datamodel/openapi/openapi-core/src/test/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClientViaConstructorTest.java b/datamodel/openapi/openapi-core/src/test/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClientViaConstructorTest.java
index a7ab44c06..2d3f02791 100644
--- a/datamodel/openapi/openapi-core/src/test/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClientViaConstructorTest.java
+++ b/datamodel/openapi/openapi-core/src/test/java/com/sap/cloud/sdk/services/openapi/apiclient/ApiClientViaConstructorTest.java
@@ -4,6 +4,13 @@
package com.sap.cloud.sdk.services.openapi.apiclient;
+import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;
+import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.ok;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
@@ -18,6 +25,7 @@
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.test.web.client.ExpectedCount;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.test.web.client.response.MockRestResponseCreators;
@@ -27,8 +35,14 @@
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
+import com.github.tomakehurst.wiremock.junit5.WireMockTest;
+import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5FactoryBuilder;
+import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5FactoryBuilder.TlsUpgrade;
+import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination;
import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
+@WireMockTest
class ApiClientViaConstructorTest
{
private static final String RELATIVE_PATH = "/apiEndpoint";
@@ -121,6 +135,45 @@ void testApiClientWithQueryParams()
server.verify();
}
+ @Test
+ void testHttpRequestConfigIsTransmitted( WireMockRuntimeInfo wm )
+ {
+ httpRequest(TlsUpgrade.DISABLED, wm.getHttpBaseUrl());
+ verify(getRequestedFor(anyUrl()).withoutHeader("Upgrade"));
+
+ httpRequest(TlsUpgrade.ENABLED, wm.getHttpBaseUrl());
+ verify(getRequestedFor(anyUrl()).withHeader("Upgrade", equalTo("TLS/1.2")));
+ }
+
+ private static void httpRequest( TlsUpgrade toggle, String url )
+ {
+ var sut = new ApacheHttpClient5FactoryBuilder().tlsUpgrade(toggle).build();
+ var httpClient = sut.createHttpClient(DefaultHttpDestination.builder(url).build());
+ var clientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
+ var restTemplate = new RestTemplate(clientHttpRequestFactory);
+ var apiClient = new ApiClient(restTemplate);
+ apiClient.setBasePath(url);
+
+ stubFor(get(anyUrl()).willReturn(ok("success")));
+
+ assertThat(
+ apiClient
+ .invokeAPI(
+ "/apiEndpoint",
+ HttpMethod.GET,
+ null,
+ null,
+ new HttpHeaders(),
+ null,
+ null,
+ null,
+ null,
+ new ParameterizedTypeReference()
+ {
+ }))
+ .isEqualTo("success");
+ }
+
private static class MyDto
{
@JsonProperty( "Return" )
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/pom.xml
index edaa6ecad..45626cdb1 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/pom.xml
@@ -4,7 +4,7 @@
com.sap.cloud.sdk.datamodel
openapi-parent
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
openapi-generator-maven-plugin
maven-plugin
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorMojo.java b/datamodel/openapi/openapi-generator-maven-plugin/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorMojo.java
index b1e2f7714..3de241031 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorMojo.java
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorMojo.java
@@ -118,6 +118,18 @@ public class DataModelGeneratorMojo extends AbstractMojo
@Parameter( property = "openapi.generate.enableOneOfAnyOfGeneration", defaultValue = "false" )
private boolean enableOneOfAnyOfGeneration;
+ /**
+ * Generate model classes. Default is true.
+ */
+ @Parameter( property = "openapi.generate.generateModels", defaultValue = "true" )
+ private boolean generateModels;
+
+ /**
+ * Generate API classes (client classes). Default is true.
+ */
+ @Parameter( property = "openapi.generate.generateApis", defaultValue = "true" )
+ private boolean generateApis;
+
/**
* Defines a list of additional properties that will be passed to the Java generator.
*/
@@ -179,6 +191,8 @@ Try retrieveGenerationConfiguration()
.deleteOutputDirectory(deleteOutputDirectory)
.additionalProperties(additionalProperties)
.oneOfAnyOfGenerationEnabled(enableOneOfAnyOfGeneration)
+ .generateModels(generateModels)
+ .generateApis(generateApis)
.build());
}
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/input/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/input/pom.xml
index 42393b95a..cd9ae73f0 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/input/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/input/pom.xml
@@ -5,7 +5,7 @@
com.company
application
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/NewSoda.java b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/NewSoda.java
index 9cd21bc5c..9d804a8b2 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/NewSoda.java
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/NewSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.datamodel.rest.sodastore.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -75,7 +73,8 @@ public class NewSoda
* Get name
* @return name The name of this {@link NewSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -103,7 +102,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link NewSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -131,7 +131,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link NewSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -159,7 +160,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link NewSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,6 +256,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/Soda.java b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/Soda.java
index 86b6a86cf..ce1a59379 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/Soda.java
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/Soda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.datamodel.rest.sodastore.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -78,7 +76,8 @@ public class Soda
* Get id
* @return id The id of this {@link Soda} instance.
*/
- @Nonnull public Long getId() {
+ @Nonnull
+ public Long getId() {
return id;
}
@@ -106,7 +105,8 @@ public void setId( @Nullable final Long id) {
* Get name
* @return name The name of this {@link Soda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -134,7 +134,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link Soda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -162,7 +163,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link Soda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -190,7 +192,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link Soda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -287,6 +290,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/UpdateSoda.java b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/UpdateSoda.java
index 80c92dc10..46a6d284a 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/UpdateSoda.java
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoIntegrationTest/sodastore/output/com/sap/cloud/sdk/datamodel/rest/sodastore/model/UpdateSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.datamodel.rest.sodastore.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -75,7 +73,8 @@ public class UpdateSoda
* Get name
* @return name The name of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -103,7 +102,8 @@ public void setName( @Nullable final String name) {
* Get brand
* @return brand The brand of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -131,7 +131,8 @@ public void setBrand( @Nullable final String brand) {
* Get flavor
* @return flavor The flavor of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -159,7 +160,8 @@ public void setFlavor( @Nullable final String flavor) {
* Get price
* @return price The price of this {@link UpdateSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,6 +256,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testAdditionalPropertiesAndEnablingAnyOfOneOf/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testAdditionalPropertiesAndEnablingAnyOfOneOf/pom.xml
index 81ad96d68..daa70e691 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testAdditionalPropertiesAndEnablingAnyOfOneOf/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testAdditionalPropertiesAndEnablingAnyOfOneOf/pom.xml
@@ -5,7 +5,7 @@
com.company
application
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testEmptyRequiredParameter/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testEmptyRequiredParameter/pom.xml
index 657408844..3d872f3c9 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testEmptyRequiredParameter/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testEmptyRequiredParameter/pom.xml
@@ -5,7 +5,7 @@
com.company
application
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithAllParameters/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithAllParameters/pom.xml
index 87b5c6433..c6d284a42 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithAllParameters/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithAllParameters/pom.xml
@@ -5,7 +5,7 @@
com.company
application
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithMandatoryParameters/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithMandatoryParameters/pom.xml
index 6e1322369..d02f3be3a 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithMandatoryParameters/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithMandatoryParameters/pom.xml
@@ -5,7 +5,7 @@
com.company
application
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithUnexpectedApiMaturity/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithUnexpectedApiMaturity/pom.xml
index 8276d8586..9c33727cb 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithUnexpectedApiMaturity/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testInvocationWithUnexpectedApiMaturity/pom.xml
@@ -5,7 +5,7 @@
com.company
application
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
diff --git a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testSkipExecution/pom.xml b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testSkipExecution/pom.xml
index 69d7c2814..a09d055c8 100644
--- a/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testSkipExecution/pom.xml
+++ b/datamodel/openapi/openapi-generator-maven-plugin/src/test/resources/DataModelGeneratorMojoUnitTest/testSkipExecution/pom.xml
@@ -5,7 +5,7 @@
com.company
application
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
diff --git a/datamodel/openapi/openapi-generator/pom.xml b/datamodel/openapi/openapi-generator/pom.xml
index 8df94a95e..7077b00b4 100644
--- a/datamodel/openapi/openapi-generator/pom.xml
+++ b/datamodel/openapi/openapi-generator/pom.xml
@@ -4,7 +4,7 @@
com.sap.cloud.sdk.datamodel
openapi-parent
- 5.13.0-SNAPSHOT
+ 5.15.0-SNAPSHOT
openapi-generator
jar
diff --git a/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GenerationConfigurationConverter.java b/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GenerationConfigurationConverter.java
index 0ffa68832..8f1744a68 100644
--- a/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GenerationConfigurationConverter.java
+++ b/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GenerationConfigurationConverter.java
@@ -56,7 +56,7 @@ static ClientOptInput convertGenerationConfiguration(
@Nonnull final GenerationConfiguration generationConfiguration,
@Nonnull final Path inputSpec )
{
- setGlobalSettings();
+ setGlobalSettings(generationConfiguration);
final var inputSpecFile = inputSpec.toString();
final var config = createCodegenConfig();
@@ -96,10 +96,17 @@ public OperationsMap postProcessOperationsWithModels(
};
}
- private static void setGlobalSettings()
+ private static void setGlobalSettings( @Nonnull final GenerationConfiguration configuration )
{
- GlobalSettings.setProperty(CodegenConstants.APIS, "");
- GlobalSettings.setProperty(CodegenConstants.MODELS, "");
+ if( configuration.isGenerateApis() ) {
+ GlobalSettings.setProperty(CodegenConstants.APIS, getAllowedIds(configuration, "apisToGenerate"));
+ }
+ if( configuration.isGenerateModels() ) {
+ GlobalSettings.setProperty(CodegenConstants.MODELS, getAllowedIds(configuration, "modelsToGenerate"));
+ }
+ if( configuration.isDebugModels() ) {
+ GlobalSettings.setProperty("debugModels", "true");
+ }
GlobalSettings.setProperty(CodegenConstants.MODEL_TESTS, Boolean.FALSE.toString());
GlobalSettings.setProperty(CodegenConstants.MODEL_DOCS, Boolean.FALSE.toString());
GlobalSettings.setProperty(CodegenConstants.API_TESTS, Boolean.FALSE.toString());
@@ -108,6 +115,15 @@ private static void setGlobalSettings()
GlobalSettings.setProperty(CodegenConstants.HIDE_GENERATION_TIMESTAMP, Boolean.TRUE.toString());
}
+ private static String getAllowedIds( @Nonnull final GenerationConfiguration config, @Nonnull final String property )
+ {
+ final var allowIds = config.getAdditionalProperties().get(property);
+ if( allowIds == null || allowIds.isBlank() ) {
+ return "";
+ }
+ return String.join(",", allowIds.trim().split("\\s+"));
+ }
+
private static OpenAPI parseOpenApiSpec( @Nonnull final String inputSpecFile )
{
final List authorizationValues = List.of();
@@ -136,7 +152,7 @@ private static Map getAdditionalProperties( @Nonnull final Gener
if( !Strings.isNullOrEmpty(copyrightHeader) ) {
result.put(COPYRIGHT_PROPERTY_KEY, copyrightHeader);
}
- result.put(CodegenConstants.SERIALIZABLE_MODEL, "true");
+ result.put(CodegenConstants.SERIALIZABLE_MODEL, "false");
result.put(JAVA_8_PROPERTY_KEY, "true");
result.put(DATE_LIBRARY_PROPERTY_KEY, "java8");
result.put(BOOLEAN_GETTER_PREFIX_PROPERTY_KEY, "is");
diff --git a/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/PreprocessingStepOrchestrator.java b/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/PreprocessingStepOrchestrator.java
index 8b3d6ca3b..e33d3225e 100644
--- a/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/PreprocessingStepOrchestrator.java
+++ b/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/PreprocessingStepOrchestrator.java
@@ -5,7 +5,6 @@
package com.sap.cloud.sdk.datamodel.openapi.generator;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -51,17 +50,14 @@ class PreprocessingStepOrchestrator
* {@code anyOfOneOfGenerationEnabled}
*
* @param anyOfOneOfGenerationEnabled
+ * true if clients should be generated for input specification with oneOf, anyOf
*
* @return this
*/
- PreprocessingStepOrchestrator enableAnyOfOneOfGeneration( @Nonnull final boolean anyOfOneOfGenerationEnabled )
+ PreprocessingStepOrchestrator enableAnyOfOneOfGeneration( final boolean anyOfOneOfGenerationEnabled )
{
if( !anyOfOneOfGenerationEnabled ) {
steps.add(ValidationKeywordsPreprocessor::new);
- } else {
- log
- .warn(
- "oneOf/anyOf keywords processing is turned on, the generated client may not be feature complete and work as expected for all cases involving anyOf/oneOf");
}
return this;
}
@@ -115,7 +111,7 @@ private Path writeProcessedSpecToTempFile( @Nonnull final JsonNode rootNode, @No
"." + fileFormat.getFileExtensions().get(0));
final String content = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(rootNode);
- Files.write(path, content.getBytes(StandardCharsets.UTF_8));
+ Files.writeString(path, content);
return path.normalize().toAbsolutePath();
}
diff --git a/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/model/GenerationConfiguration.java b/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/model/GenerationConfiguration.java
index 8ad9bb9b8..881a01295 100644
--- a/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/model/GenerationConfiguration.java
+++ b/datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/model/GenerationConfiguration.java
@@ -56,6 +56,15 @@ public class GenerationConfiguration
@Builder.Default
boolean oneOfAnyOfGenerationEnabled = false;
+ @Builder.Default
+ boolean generateModels = true;
+
+ @Builder.Default
+ boolean generateApis = true;
+
+ @Builder.Default
+ boolean debugModels = false;
+
/**
* Indicates whether to use the default SAP copyright header for generated files.
*
diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/resttemplate/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/resttemplate/api.mustache
index e11846e89..a654ec271 100644
--- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/resttemplate/api.mustache
+++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/resttemplate/api.mustache
@@ -30,7 +30,10 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.annotations.Beta;
-import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
+{{^aiSdkConstructor}}import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
+{{/aiSdkConstructor}}
+{{#aiSdkConstructor}}import com.sap.ai.sdk.core.AiCoreService;
+{{/aiSdkConstructor}}
/**
* {{appName}} in version {{version}}.
@@ -40,6 +43,7 @@ import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
@Beta{{/isReleased}}
{{#operations}}
public class {{classname}} extends AbstractOpenApiService {
+{{^aiSdkConstructor}}
/**
* Instantiates this API class to invoke operations on the {{appName}}.
*
@@ -61,6 +65,27 @@ public class {{classname}} extends AbstractOpenApiService {
{
super(apiClient);
}
+{{/aiSdkConstructor}}
+{{#aiSdkConstructor}}
+
+ /**
+ * Instantiates this API class to invoke operations on the {{appName}}
+ */
+ public {{classname}}()
+ {
+ super(new AiCoreService().getApiClient());
+ }
+
+ /**
+ * Instantiates this API class to invoke operations on the {{appName}}
+ *
+ * @param aiCoreService The configured connectivity instance to AI Core
+ */
+ public {{classname}}( @Nonnull final AiCoreService aiCoreService )
+ {
+ super(aiCoreService.getApiClient());
+ }
+{{/aiSdkConstructor}}
{{#operation}}{{#hasOptionalParams}}
/**
diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/model.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/model.mustache
index 11bc4795e..1ce0b522e 100644
--- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/model.mustache
+++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/model.mustache
@@ -10,11 +10,11 @@ package {{package}};
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
{{/useReflectionEqualsHashCode}}
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
{{#imports}}
import {{import}};
@@ -27,14 +27,33 @@ import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
{{#withXml}}
import com.fasterxml.jackson.dataformat.xml.annotation.*;
{{/withXml}}
+{{#vendorExtensions.x-has-readonly-properties}}
+import com.fasterxml.jackson.annotation.JsonCreator;
+{{/vendorExtensions.x-has-readonly-properties}}
{{/jackson}}
{{#withXml}}
import {{javaxPackage}}.xml.bind.annotation.*;
+import {{javaxPackage}}.xml.bind.annotation.adapters.*;
+import io.github.threetenjaxb.core.*;
{{/withXml}}
+{{#jsonb}}
+import java.lang.reflect.Type;
+import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer;
+import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer;
+import {{javaxPackage}}.json.bind.serializer.DeserializationContext;
+import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer;
+import {{javaxPackage}}.json.bind.serializer.JsonbSerializer;
+import {{javaxPackage}}.json.bind.serializer.SerializationContext;
+import {{javaxPackage}}.json.stream.JsonGenerator;
+import {{javaxPackage}}.json.stream.JsonParser;
+import {{javaxPackage}}.json.bind.annotation.JsonbProperty;
+{{#vendorExtensions.x-has-readonly-properties}}
+import {{javaxPackage}}.json.bind.annotation.JsonbCreator;
+{{/vendorExtensions.x-has-readonly-properties}}
+{{/jsonb}}
{{#parcelableModel}}
import android.os.Parcelable;
import android.os.Parcel;
@@ -57,6 +76,6 @@ import {{javaxPackage}}.annotation.Nullable;
{{#models}}
{{#model}}
-{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}}
+{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>pojo}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}}
{{/model}}
{{/models}}
diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelEnum.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelEnum.mustache
index 6de2249ab..af40d5209 100644
--- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelEnum.mustache
+++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelEnum.mustache
@@ -2,10 +2,27 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
{{/jackson}}
+{{#gson}}
+import java.io.IOException;
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+{{/gson}}
+{{#isUri}}
+import java.net.URI;
+{{/isUri}}
/**
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
*/
+{{#gson}}
+@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class)
+{{/gson}}
+{{#jsonb}}
+@JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class)
+@JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class)
+{{/jsonb}}
{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
{{#allowableValues}}{{#enumVars}}
{{#enumDescription}}
@@ -61,6 +78,42 @@ import com.fasterxml.jackson.annotation.JsonValue;
}
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}}
}
+{{#gson}}
+
+ public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> {
+ @Override
+ public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException {
+ jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}});
+ }
+
+ @Override
+ public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException {
+ {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}}{{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}};
+ return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}});
+ }
+ }
+{{/gson}}
+{{#jsonb}}
+
+ public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> {
+ @Override
+ public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
+ for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
+ if (String.valueOf(b.value).equals(parser.getString())) {
+ return b;
+ }
+ }
+ {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}}
+ }
+ }
+
+ public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> {
+ @Override
+ public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) {
+ generator.write(obj.value);
+ }
+ }
+{{/jsonb}}
{{#supportUrlQuery}}
/**
diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelInnerEnum.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelInnerEnum.mustache
index 7785a086a..2472a72c4 100644
--- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelInnerEnum.mustache
+++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/modelInnerEnum.mustache
@@ -1,6 +1,13 @@
/**
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
*/
+{{#gson}}
+ @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class)
+{{/gson}}
+{{#jsonb}}
+ @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class)
+ @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class)
+{{/jsonb}}
{{#withXml}}
@XmlType(name="{{datatypeWithEnum}}")
@XmlEnum({{dataType}}.class)
@@ -66,4 +73,39 @@
}
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}}
}
+{{#gson}}
+
+ public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> {
+ @Override
+ public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException {
+ jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}});
+ }
+
+ @Override
+ public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException {
+ {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} {{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}};
+ return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}});
+ }
+ }
+{{/gson}}
+{{#jsonb}}
+ public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> {
+ @Override
+ public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
+ for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
+ if (String.valueOf(b.value).equals(parser.getString())) {
+ return b;
+ }
+ }
+ {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}}
+ }
+ }
+
+ public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> {
+ @Override
+ public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) {
+ generator.write(obj.value);
+ }
+ }
+{{/jsonb}}
}
diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/oneof_interface.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/oneof_interface.mustache
new file mode 100644
index 000000000..874a1ba63
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/oneof_interface.mustache
@@ -0,0 +1,11 @@
+/**
+ * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}}
+ * @deprecated{{/isDeprecated}}
+ */{{#isDeprecated}}
+@Deprecated{{/isDeprecated}}
+{{>additionalOneOfTypeAnnotations}}{{>typeInfoAnnotation}}{{>xmlAnnotation}}
+public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} {
+ {{#discriminator}}
+ {{propertyType}} {{propertyGetter}}();
+ {{/discriminator}}
+}
diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/pojo.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/pojo.mustache
index 43d82e905..3f43f0bad 100644
--- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/pojo.mustache
+++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/pojo.mustache
@@ -2,13 +2,30 @@
* {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}}
* @deprecated{{/isDeprecated}}
*/{{#isDeprecated}}
-@Deprecated{{/isDeprecated}}{{#discriminator}}
-{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}{{^isReleased}}
-@Beta{{/isReleased}}
-// CHECKSTYLE:OFF
-public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcelableModel}}implements Parcelable {{/parcelableModel}}{{^parcelableModel}}{{/parcelableModel}}
+@Deprecated{{/isDeprecated}}
+{{#swagger1AnnotationLibrary}}
+{{#description}}
+@ApiModel(description = "{{{.}}}")
+{{/description}}
+{{/swagger1AnnotationLibrary}}
+{{#swagger2AnnotationLibrary}}
+{{#description}}
+@Schema(description = "{{{.}}}")
+{{/description}}
+{{/swagger2AnnotationLibrary}}
+{{#jackson}}
+{{#isClassnameSanitized}}
+{{/isClassnameSanitized}}
+{{/jackson}}
+{{>additionalModelTypeAnnotations}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}{{^isReleased}}
+@Beta{{/isReleased}}// CHECKSTYLE:OFF
+public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}
// CHECKSTYLE:ON
{
+{{#serializableModel}}
+ private static final long serialVersionUID = 1L;
+
+{{/serializableModel}}
{{#vars}}
{{#isEnum}}
{{^isContainer}}
@@ -22,40 +39,40 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
{{/isEnum}}
{{#jackson}}
@JsonProperty("{{baseName}}")
- {{#withXml}}
- {{^isContainer}}
- @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/isContainer}}
- {{#isContainer}}
- {{#isXmlWrapped}}
- // items.xmlName={{items.xmlName}}
- @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
- {{/isXmlWrapped}}
- {{/isContainer}}
- {{/withXml}}
{{/jackson}}
{{#withXml}}
- {{#isXmlAttribute}}
- @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/isXmlAttribute}}
- {{^isXmlAttribute}}
- {{^isContainer}}
- @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/isContainer}}
- {{#isContainer}}
- // Is a container wrapped={{isXmlWrapped}}
- {{#items}}
- // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
- // items.example={{example}} items.type={{dataType}}
- @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/items}}
- {{#isXmlWrapped}}
- @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/isXmlWrapped}}
- {{/isContainer}}
- {{/isXmlAttribute}}
+ @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
+ {{#isXmlWrapped}}
+ @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
+ {{/isXmlWrapped}}
+ {{^isXmlAttribute}}
+ {{#isDateTime}}
+ @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class)
+ {{/isDateTime}}
+ {{/isXmlAttribute}}
{{/withXml}}
- private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
+ {{#gson}}
+ @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
+ {{/gson}}
+ {{#vendorExtensions.x-field-extra-annotation}}
+ {{{vendorExtensions.x-field-extra-annotation}}}
+ {{/vendorExtensions.x-field-extra-annotation}}
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isContainer}}
+ {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();
+ {{/isContainer}}
+ {{^isContainer}}
+ {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
+ {{/isContainer}}
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isContainer}}
+ {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
+ {{/isContainer}}
+ {{^isContainer}}
+ {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
+ {{/isContainer}}
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
{{/vars}}
@JsonAnySetter
@@ -63,13 +80,24 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
{{#parcelableModel}}
public {{classname}}() {
- {{#parent}}
- super();
- {{/parent}}
+ {{#parent}}
+ {{#parcelableModel}}
+ super();{{/parcelableModel}}
+ {{/parent}}
+ {{#gson}}
+ {{#discriminator}}
+ {{#discriminator.isEnum}}
+ this.{{{discriminatorName}}} = this.getClass().getSimpleName();
+ {{/discriminator.isEnum}}
+ {{/discriminator}}
+ {{/gson}}
}
{{/parcelableModel}}
{{^parcelableModel}}
{{#pojoConstructorVisibility}}
+ /**
+ * Default constructor for {{classname}}.
+ */
{{pojoConstructorVisibility}} {{classname}}() { {{#parent}}super();{{/parent}} }
{{/pojoConstructorVisibility}}
{{/parcelableModel}}
@@ -99,11 +127,24 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
* @return The same instance of type {@link {{classname}}}
*/
@Nonnull public {{classname}} add{{nameInPascalCase}}Item( @Nonnull final {{{items.datatypeWithEnum}}} {{name}}Item) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ if (this.{{name}} == null || !this.{{name}}.isPresent()) {
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}});
+ }
+ try {
+ this.{{name}}.get().add({{name}}Item);
+ } catch (java.util.NoSuchElementException e) {
+ // this can never happen, as we make sure above that the value is present
+ }
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
this.{{name}}.add({{name}}Item);
return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
}
{{/isArray}}
{{#isMap}}
@@ -115,9 +156,26 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
* @return The same instance of type {@link {{classname}}}
*/
@Nonnull public {{classname}} put{{nameInCamelCase}}Item( @Nonnull final String key, {{#items.isNullable}}@Nullable{{/items.isNullable}}{{^items.isNullable}}@Nonnull{{/items.isNullable}} final {{{items.datatypeWithEnum}}} {{name}}Item) {
- this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ if (this.{{name}} == null || !this.{{name}}.isPresent()) {
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}});
+ }
+ try {
+ this.{{name}}.get().put(key, {{name}}Item);
+ } catch (java.util.NoSuchElementException e) {
+ // this can never happen, as we make sure above that the value is present
+ }
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^required}}
+ if (this.{{name}} == null) {
+ this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
+ }
+ {{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
}
{{/isMap}}
@@ -136,17 +194,35 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
* maximum: {{.}}
{{/maximum}}
* @return {{name}} The {{name}} of this {@link {{classname}}} instance.
- {{#deprecated}}
+ {{#deprecated}}
* @deprecated
- {{/deprecated}}
+ {{/deprecated}}
*/
- {{#deprecated}}
+{{#deprecated}}
@Deprecated
- {{/deprecated}}
-{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}{{#vendorExtensions.extraAnnotation}}
- {{{vendorExtensions.extraAnnotation}}}
-{{/vendorExtensions.extraAnnotation}}
- {{#isNullable}}@Nullable{{/isNullable}}{{^isNullable}}@Nonnull{{/isNullable}} public {{{datatypeWithEnum}}} {{getter}}() {
+{{/deprecated}}
+{{#isNullable}}
+ @Nullable
+{{/isNullable}}
+{{^isNullable}}
+ @Nonnull
+{{/isNullable}}
+{{#jsonb}}
+ @JsonbProperty("{{baseName}}")
+{{/jsonb}}
+{{#useBeanValidation}}
+{{>beanValidation}}
+{{/useBeanValidation}}
+{{#swagger1AnnotationLibrary}}
+ @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
+{{/swagger1AnnotationLibrary}}
+{{#swagger2AnnotationLibrary}}
+ @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}")
+{{/swagger2AnnotationLibrary}}
+{{#vendorExtensions.x-extra-annotation}}
+ {{{vendorExtensions.x-extra-annotation}}}
+{{/vendorExtensions.x-extra-annotation}}
+ public {{{datatypeWithEnum}}} {{getter}}() {
return {{name}}{{#isByteArray}}.clone(){{/isByteArray}};
}
{{^isReadOnly}}
@@ -206,7 +282,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
{{#parent}}
- {{#allVars}}
+ {{#readWriteVars}}
{{#isOverridden}}
@Override
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
@@ -220,7 +296,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
}
{{/isOverridden}}
- {{/allVars}}
+ {{/readWriteVars}}
{{/parent}}
@Override
public boolean equals(@Nullable final java.lang.Object o) {
@@ -271,12 +347,23 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
{{/parent}}
{{#vars}}
- sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n");
+ sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n");
{{/vars}}
cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
sb.append("}");
return sb.toString();
}
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
{{#supportUrlQuery}}
/**
@@ -471,18 +558,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
return joiner.toString();
}
{{/supportUrlQuery}}
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(final java.lang.Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-
{{#parcelableModel}}
public void writeToParcel(Parcel out, int flags) {
diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/typeInfoAnnotation.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/typeInfoAnnotation.mustache
index b7f87b12c..a04bcf4fc 100644
--- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/typeInfoAnnotation.mustache
+++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/typeInfoAnnotation.mustache
@@ -1,16 +1,18 @@
{{#jackson}}
-
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true)
-{{#discriminator.mappedModels}}
-{{#-first}}
+{{#discriminator}}
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "{{{discriminator.propertyBaseName}}}", visible = true)
+{{/discriminator}}
+{{^discriminator}}
+@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)
+{{/discriminator}}
@JsonSubTypes({
-{{/-first}}
- @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
-{{#-last}}
-})
-{{/-last}}
+{{#discriminator.mappedModels}}
+ @JsonSubTypes.Type(value = {{modelName}}.class{{#discriminator}}, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"{{/discriminator}}),
{{/discriminator.mappedModels}}
-{{#isClassnameSanitized}}
-@JsonTypeName("{{name}}")
-{{/isClassnameSanitized}}
+{{^discriminator.mappedModels}}
+{{#model.oneOf}}
+ @JsonSubTypes.Type(value = {{.}}.class),
+{{/model.oneOf}}
+{{/discriminator.mappedModels}}
+})
{{/jackson}}
\ No newline at end of file
diff --git a/datamodel/openapi/openapi-generator/src/test/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorIntegrationTest.java b/datamodel/openapi/openapi-generator/src/test/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorIntegrationTest.java
index 2410f22ff..c2d75fe9f 100644
--- a/datamodel/openapi/openapi-generator/src/test/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorIntegrationTest.java
+++ b/datamodel/openapi/openapi-generator/src/test/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorIntegrationTest.java
@@ -9,6 +9,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.util.Map;
import java.util.function.Predicate;
import org.junit.jupiter.api.io.TempDir;
@@ -20,16 +21,24 @@
import com.sap.cloud.sdk.datamodel.openapi.generator.model.GenerationResult;
import io.vavr.control.Try;
-import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
class DataModelGeneratorIntegrationTest
{
@RequiredArgsConstructor
- @AllArgsConstructor
private enum TestCase
{
+ API_CLASS_FOR_AI_SDK(
+ "api-class-for-ai-sdk",
+ "sodastore.json",
+ "com.sap.cloud.sdk.services.builder.api",
+ "com.sap.cloud.sdk.services.builder.model",
+ ApiMaturity.RELEASED,
+ true,
+ true,
+ 6,
+ Map.of("aiSdkConstructor", "true")),
API_CLASS_VENDOR_EXTENSION_YAML(
"api-class-vendor-extension-yaml",
"sodastore.yaml",
@@ -37,7 +46,9 @@ private enum TestCase
"com.sap.cloud.sdk.services.apiclassvendorextension.model",
ApiMaturity.RELEASED,
false,
- 4),
+ true,
+ 4,
+ Map.of()),
API_CLASS_VENDOR_EXTENSION_JSON(
"api-class-vendor-extension-json",
"sodastore.json",
@@ -45,7 +56,9 @@ private enum TestCase
"com.sap.cloud.sdk.services.apiclassvendorextension.model",
ApiMaturity.RELEASED,
false,
- 6),
+ true,
+ 6,
+ Map.of()),
INPUT_SPEC_WITH_UPPERCASE_FILE_EXTENSION(
"input-spec-with-uppercase-file-extension",
"sodastore.JSON",
@@ -53,15 +66,29 @@ private enum TestCase
"com.sap.cloud.sdk.services.uppercasefileextension.model",
ApiMaturity.RELEASED,
false,
- 6),
- INPUT_SPEC_WITH_ANYOF_ONEOF(
- "input-spec-with-anyof-oneof",
- "AggregatorNestedSchemaChild.json",
- "com.sap.cloud.sdk.services.anyofoneof.api",
- "com.sap.cloud.sdk.services.anyofoneof.model",
+ true,
+ 6,
+ Map.of()),
+ ONE_OF_INTERFACES_DISABLED(
+ "oneof-interfaces-disabled",
+ "sodastore.yaml",
+ "test",
+ "test",
ApiMaturity.RELEASED,
+ false,
true,
- 7),
+ 8,
+ Map.of()),
+ ONE_OF_INTERFACES_ENABLED(
+ "oneof-interfaces-enabled",
+ "sodastore.yaml",
+ "test",
+ "test",
+ ApiMaturity.RELEASED,
+ true,
+ true,
+ 8,
+ Map.of("useOneOfInterfaces", "true")),
INPUT_SPEC_WITH_BUILDER(
"input-spec-with-builder",
"sodastore.JSON",
@@ -69,10 +96,43 @@ private enum TestCase
"com.sap.cloud.sdk.services.builder.model",
ApiMaturity.RELEASED,
true,
+ true,
6,
- "builder",
- "build",
- "private");
+ Map
+ .of(
+ "pojoBuilderMethodName",
+ "builder",
+ "pojoBuildMethodName",
+ "build",
+ "pojoConstructorVisibility",
+ "private")),
+ REMOVE_OPERATION_ID_PREFIX(
+ "remove-operation-id-prefix",
+ "sodastore.json",
+ "com.sap.cloud.sdk.services.builder.api",
+ "com.sap.cloud.sdk.services.builder.model",
+ ApiMaturity.RELEASED,
+ true,
+ true,
+ 6,
+ Map
+ .of(
+ "removeOperationIdPrefix",
+ "true",
+ "removeOperationIdPrefixDelimiter",
+ "\\.",
+ "removeOperationIdPrefixCount",
+ "3")),
+ GENERATE_APIS(
+ "generate-apis",
+ "sodastore.yaml",
+ "test",
+ "test",
+ ApiMaturity.RELEASED,
+ true,
+ false,
+ 7,
+ Map.of());
final String testCaseName;
final String inputSpecFileName;
@@ -80,10 +140,9 @@ private enum TestCase
final String modelPackageName;
final ApiMaturity apiMaturity;
final boolean anyOfOneOfGenerationEnabled;
+ final boolean generateApis;
final int expectedNumberOfGeneratedFiles;
- String methodBuilder = null;
- String methodBuild = null;
- String constructorVisibility = null;
+ final Map additionalProperties;
}
@ParameterizedTest
@@ -101,24 +160,23 @@ void integrationTests( final TestCase testCase, @TempDir final Path path )
assertThat(tempOutputDirectory).exists().isReadable().isDirectory();
assertThat(comparisonDirectory).exists().isReadable().isDirectory();
- final GenerationConfiguration generationConfiguration =
+ final var generationConfiguration =
GenerationConfiguration
.builder()
+ // .debugModels(true) enable this for better mustache file debugging
.apiPackage(testCase.apiPackageName)
+ .generateApis(testCase.generateApis)
.modelPackage(testCase.modelPackageName)
.inputSpec(inputDirectory.resolve(testCase.inputSpecFileName).toAbsolutePath().toString())
.apiMaturity(testCase.apiMaturity)
.outputDirectory(tempOutputDirectory.toAbsolutePath().toString())
.withSapCopyrightHeader(true)
.oneOfAnyOfGenerationEnabled(testCase.anyOfOneOfGenerationEnabled)
- .additionalProperty("useAbstractionForFiles", "true")
- .additionalProperty("pojoBuilderMethodName", testCase.methodBuilder)
- .additionalProperty("pojoBuildMethodName", testCase.methodBuild)
- .additionalProperty("pojoConstructorVisibility", testCase.constructorVisibility)
- .build();
+ .additionalProperty("useAbstractionForFiles", "true");
+ testCase.additionalProperties.forEach(generationConfiguration::additionalProperty);
final Try maybeGenerationResult =
- new DataModelGenerator().generateDataModel(generationConfiguration);
+ new DataModelGenerator().generateDataModel(generationConfiguration.build());
assertThat(maybeGenerationResult.get().getGeneratedFiles()).hasSize(testCase.expectedNumberOfGeneratedFiles);
@@ -135,12 +193,13 @@ void generateDataModelForComparison( final TestCase testCase )
final Path outputDirectory = getComparisonDirectory(testCase);
assertThat(inputDirectory).exists().isReadable().isDirectory();
- assertThat(inputDirectory).exists().isReadable().isDirectory();
+ assertThat(outputDirectory).exists().isReadable().isDirectory();
- final GenerationConfiguration generationConfiguration =
+ final var generationConfiguration =
GenerationConfiguration
.builder()
.apiPackage(testCase.apiPackageName)
+ .generateApis(testCase.generateApis)
.modelPackage(testCase.modelPackageName)
.inputSpec(inputDirectory.resolve(testCase.inputSpecFileName).toAbsolutePath().toString())
.apiMaturity(testCase.apiMaturity)
@@ -148,13 +207,11 @@ void generateDataModelForComparison( final TestCase testCase )
.deleteOutputDirectory(true)
.withSapCopyrightHeader(true)
.oneOfAnyOfGenerationEnabled(testCase.anyOfOneOfGenerationEnabled)
- .additionalProperty("useAbstractionForFiles", "true")
- .additionalProperty("pojoBuilderMethodName", testCase.methodBuilder)
- .additionalProperty("pojoBuildMethodName", testCase.methodBuild)
- .additionalProperty("pojoConstructorVisibility", testCase.constructorVisibility)
- .build();
+ .additionalProperty("useAbstractionForFiles", "true");
+ testCase.additionalProperties.forEach(generationConfiguration::additionalProperty);
- new DataModelGenerator().generateDataModel(generationConfiguration);
+ GenerationConfiguration build = generationConfiguration.build();
+ new DataModelGenerator().generateDataModel(build);
}
private static Path getInputDirectory( final TestCase testCase )
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/input/sodastore.json b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/input/sodastore.json
new file mode 100644
index 000000000..f10d46994
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/input/sodastore.json
@@ -0,0 +1,235 @@
+{
+ "openapi": "3.0.0",
+ "info": {
+ "title": "Soda Store API",
+ "version": "1.0.0",
+ "description": "API for managing sodas in a soda store"
+ },
+ "paths": {
+ "/sodas": {
+ "get": {
+ "summary": "Get a list of all sodas",
+ "x-sap-cloud-sdk-api-name": "AwesomeSodas",
+ "operationId": "getSodas",
+ "responses": {
+ "200": {
+ "description": "A list of sodas",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Soda"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "summary": "Add a new soda to the store",
+ "x-sap-cloud-sdk-api-name": "AwesomeSoda",
+ "operationId": "addSoda",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NewSoda"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "The newly added soda",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Soda"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/sodas/{sodaId}": {
+ "get": {
+ "summary": "Get details of a specific soda",
+ "operationId": "getSodaById",
+ "parameters": [
+ {
+ "name": "sodaId",
+ "in": "path",
+ "description": "ID of the soda to retrieve",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The requested soda",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Soda"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Soda not found"
+ }
+ }
+ },
+ "put": {
+ "summary": "Update details of a specific soda",
+ "operationId": "updateSodaById",
+ "parameters": [
+ {
+ "name": "sodaId",
+ "in": "path",
+ "description": "ID of the soda to update",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateSoda"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "The updated soda",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Soda"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Soda not found"
+ }
+ }
+ },
+ "delete": {
+ "summary": "Delete a specific soda from the store",
+ "operationId": "deleteSodaById",
+ "parameters": [
+ {
+ "name": "sodaId",
+ "in": "path",
+ "description": "ID of the soda to delete",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Soda successfully deleted"
+ },
+ "404": {
+ "description": "Soda not found"
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "Soda": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ },
+ "brand": {
+ "type": "string"
+ },
+ "flavor": {
+ "type": "string"
+ },
+ "price": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ "required": ["name", "brand", "flavor", "price"]
+ },
+ "NewSoda": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "brand": {
+ "type": "string"
+ },
+ "zero": {
+ "type": "boolean"
+ },
+ "since": {
+ "type": "string",
+ "format": "date"
+ },
+ "flavor": {
+ "type": "string"
+ },
+ "price": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ "required": ["name", "brand", "flavor", "price"]
+ },
+ "UpdateSoda": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "zero": {
+ "type": "boolean"
+ },
+ "since": {
+ "type": "string",
+ "format": "date"
+ },
+ "brand": {
+ "type": "string"
+ },
+ "flavor": {
+ "type": "string"
+ },
+ "price": {
+ "type": "number",
+ "format": "float"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/AwesomeSodaApi.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/AwesomeSodaApi.java
new file mode 100644
index 000000000..8f6d7482f
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/AwesomeSodaApi.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+package com.sap.cloud.sdk.services.builder.api;
+
+import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
+import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse;
+import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
+import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
+
+import com.sap.cloud.sdk.services.builder.model.NewSoda;
+import com.sap.cloud.sdk.services.builder.model.Soda;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import com.google.common.annotations.Beta;
+
+import com.sap.ai.sdk.core.AiCoreService;
+
+/**
+ * Soda Store API in version 1.0.0.
+ *
+ * API for managing sodas in a soda store
+ */
+public class AwesomeSodaApi extends AbstractOpenApiService {
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API
+ */
+ public AwesomeSodaApi()
+ {
+ super(new AiCoreService().getApiClient());
+ }
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API
+ *
+ * @param aiCoreService The configured connectivity instance to AI Core
+ */
+ public AwesomeSodaApi( @Nonnull final AiCoreService aiCoreService )
+ {
+ super(aiCoreService.getApiClient());
+ }
+
+ /**
+ * Add a new soda to the store
+ *
+ * 201 - The newly added soda
+ * @param newSoda
+ * The value for the parameter newSoda
+ * @return Soda
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public Soda addSoda( @Nonnull final NewSoda newSoda) throws OpenApiRequestException {
+ final Object localVarPostBody = newSoda;
+
+ // verify the required parameter 'newSoda' is set
+ if (newSoda == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'newSoda' when calling addSoda");
+ }
+
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { };
+
+ final ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/AwesomeSodasApi.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/AwesomeSodasApi.java
new file mode 100644
index 000000000..de3d15ef0
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/AwesomeSodasApi.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+package com.sap.cloud.sdk.services.builder.api;
+
+import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
+import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse;
+import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
+import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
+
+import com.sap.cloud.sdk.services.builder.model.Soda;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import com.google.common.annotations.Beta;
+
+import com.sap.ai.sdk.core.AiCoreService;
+
+/**
+ * Soda Store API in version 1.0.0.
+ *
+ * API for managing sodas in a soda store
+ */
+public class AwesomeSodasApi extends AbstractOpenApiService {
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API
+ */
+ public AwesomeSodasApi()
+ {
+ super(new AiCoreService().getApiClient());
+ }
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API
+ *
+ * @param aiCoreService The configured connectivity instance to AI Core
+ */
+ public AwesomeSodasApi( @Nonnull final AiCoreService aiCoreService )
+ {
+ super(aiCoreService.getApiClient());
+ }
+
+ /**
+ * Get a list of all sodas
+ *
+ * 200 - A list of sodas
+ * @return List<Soda>
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public List getSodas() throws OpenApiRequestException {
+ final Object localVarPostBody = null;
+
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { };
+
+ final ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/DefaultApi.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/DefaultApi.java
new file mode 100644
index 000000000..90ca1b254
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/api/DefaultApi.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+package com.sap.cloud.sdk.services.builder.api;
+
+import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
+import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse;
+import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
+import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
+
+import com.sap.cloud.sdk.services.builder.model.Soda;
+import com.sap.cloud.sdk.services.builder.model.UpdateSoda;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import com.google.common.annotations.Beta;
+
+import com.sap.ai.sdk.core.AiCoreService;
+
+/**
+ * Soda Store API in version 1.0.0.
+ *
+ * API for managing sodas in a soda store
+ */
+public class DefaultApi extends AbstractOpenApiService {
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API
+ */
+ public DefaultApi()
+ {
+ super(new AiCoreService().getApiClient());
+ }
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API
+ *
+ * @param aiCoreService The configured connectivity instance to AI Core
+ */
+ public DefaultApi( @Nonnull final AiCoreService aiCoreService )
+ {
+ super(aiCoreService.getApiClient());
+ }
+
+ /**
+ * Delete a specific soda from the store
+ *
+ * 204 - Soda successfully deleted
+ *
404 - Soda not found
+ * @param sodaId
+ * ID of the soda to delete
+ * @return An OpenApiResponse containing the status code of the HttpResponse.
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public OpenApiResponse deleteSodaById( @Nonnull final Long sodaId) throws OpenApiRequestException {
+ final Object localVarPostBody = null;
+
+ // verify the required parameter 'sodaId' is set
+ if (sodaId == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'sodaId' when calling deleteSodaById");
+ }
+
+ // create path and map variables
+ final Map localVarPathParams = new HashMap();
+ localVarPathParams.put("sodaId", sodaId);
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas/{sodaId}").buildAndExpand(localVarPathParams).toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = { };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { };
+
+ final ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ apiClient.invokeAPI(localVarPath, HttpMethod.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ return new OpenApiResponse(apiClient);
+ }
+ /**
+ * Get details of a specific soda
+ *
+ * 200 - The requested soda
+ *
404 - Soda not found
+ * @param sodaId
+ * ID of the soda to retrieve
+ * @return Soda
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public Soda getSodaById( @Nonnull final Long sodaId) throws OpenApiRequestException {
+ final Object localVarPostBody = null;
+
+ // verify the required parameter 'sodaId' is set
+ if (sodaId == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'sodaId' when calling getSodaById");
+ }
+
+ // create path and map variables
+ final Map localVarPathParams = new HashMap();
+ localVarPathParams.put("sodaId", sodaId);
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas/{sodaId}").buildAndExpand(localVarPathParams).toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { };
+
+ final ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+ /**
+ * Update details of a specific soda
+ *
+ * 200 - The updated soda
+ *
404 - Soda not found
+ * @param sodaId
+ * ID of the soda to update
+ * @param updateSoda
+ * The value for the parameter updateSoda
+ * @return Soda
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public Soda updateSodaById( @Nonnull final Long sodaId, @Nonnull final UpdateSoda updateSoda) throws OpenApiRequestException {
+ final Object localVarPostBody = updateSoda;
+
+ // verify the required parameter 'sodaId' is set
+ if (sodaId == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'sodaId' when calling updateSodaById");
+ }
+
+ // verify the required parameter 'updateSoda' is set
+ if (updateSoda == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'updateSoda' when calling updateSodaById");
+ }
+
+ // create path and map variables
+ final Map localVarPathParams = new HashMap();
+ localVarPathParams.put("sodaId", sodaId);
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas/{sodaId}").buildAndExpand(localVarPathParams).toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { };
+
+ final ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/NewSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/NewSoda.java
new file mode 100644
index 000000000..98a68c017
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/NewSoda.java
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.services.builder.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.time.LocalDate;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * NewSoda
+ */
+// CHECKSTYLE:OFF
+public class NewSoda
+// CHECKSTYLE:ON
+{
+ @JsonProperty("name")
+ private String name;
+
+ @JsonProperty("brand")
+ private String brand;
+
+ @JsonProperty("zero")
+ private Boolean zero;
+
+ @JsonProperty("since")
+ private LocalDate since;
+
+ @JsonProperty("flavor")
+ private String flavor;
+
+ @JsonProperty("price")
+ private Float price;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the name of this {@link NewSoda} instance and return the same instance.
+ *
+ * @param name The name of this {@link NewSoda}
+ * @return The same instance of this {@link NewSoda} class
+ */
+ @Nonnull public NewSoda name( @Nonnull final String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name The name of this {@link NewSoda} instance.
+ */
+ @Nonnull
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the name of this {@link NewSoda} instance.
+ *
+ * @param name The name of this {@link NewSoda}
+ */
+ public void setName( @Nonnull final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set the brand of this {@link NewSoda} instance and return the same instance.
+ *
+ * @param brand The brand of this {@link NewSoda}
+ * @return The same instance of this {@link NewSoda} class
+ */
+ @Nonnull public NewSoda brand( @Nonnull final String brand) {
+ this.brand = brand;
+ return this;
+ }
+
+ /**
+ * Get brand
+ * @return brand The brand of this {@link NewSoda} instance.
+ */
+ @Nonnull
+ public String getBrand() {
+ return brand;
+ }
+
+ /**
+ * Set the brand of this {@link NewSoda} instance.
+ *
+ * @param brand The brand of this {@link NewSoda}
+ */
+ public void setBrand( @Nonnull final String brand) {
+ this.brand = brand;
+ }
+
+ /**
+ * Set the zero of this {@link NewSoda} instance and return the same instance.
+ *
+ * @param zero The zero of this {@link NewSoda}
+ * @return The same instance of this {@link NewSoda} class
+ */
+ @Nonnull public NewSoda zero( @Nullable final Boolean zero) {
+ this.zero = zero;
+ return this;
+ }
+
+ /**
+ * Get zero
+ * @return zero The zero of this {@link NewSoda} instance.
+ */
+ @Nonnull
+ public Boolean isZero() {
+ return zero;
+ }
+
+ /**
+ * Set the zero of this {@link NewSoda} instance.
+ *
+ * @param zero The zero of this {@link NewSoda}
+ */
+ public void setZero( @Nullable final Boolean zero) {
+ this.zero = zero;
+ }
+
+ /**
+ * Set the since of this {@link NewSoda} instance and return the same instance.
+ *
+ * @param since The since of this {@link NewSoda}
+ * @return The same instance of this {@link NewSoda} class
+ */
+ @Nonnull public NewSoda since( @Nullable final LocalDate since) {
+ this.since = since;
+ return this;
+ }
+
+ /**
+ * Get since
+ * @return since The since of this {@link NewSoda} instance.
+ */
+ @Nonnull
+ public LocalDate getSince() {
+ return since;
+ }
+
+ /**
+ * Set the since of this {@link NewSoda} instance.
+ *
+ * @param since The since of this {@link NewSoda}
+ */
+ public void setSince( @Nullable final LocalDate since) {
+ this.since = since;
+ }
+
+ /**
+ * Set the flavor of this {@link NewSoda} instance and return the same instance.
+ *
+ * @param flavor The flavor of this {@link NewSoda}
+ * @return The same instance of this {@link NewSoda} class
+ */
+ @Nonnull public NewSoda flavor( @Nonnull final String flavor) {
+ this.flavor = flavor;
+ return this;
+ }
+
+ /**
+ * Get flavor
+ * @return flavor The flavor of this {@link NewSoda} instance.
+ */
+ @Nonnull
+ public String getFlavor() {
+ return flavor;
+ }
+
+ /**
+ * Set the flavor of this {@link NewSoda} instance.
+ *
+ * @param flavor The flavor of this {@link NewSoda}
+ */
+ public void setFlavor( @Nonnull final String flavor) {
+ this.flavor = flavor;
+ }
+
+ /**
+ * Set the price of this {@link NewSoda} instance and return the same instance.
+ *
+ * @param price The price of this {@link NewSoda}
+ * @return The same instance of this {@link NewSoda} class
+ */
+ @Nonnull public NewSoda price( @Nonnull final Float price) {
+ this.price = price;
+ return this;
+ }
+
+ /**
+ * Get price
+ * @return price The price of this {@link NewSoda} instance.
+ */
+ @Nonnull
+ public Float getPrice() {
+ return price;
+ }
+
+ /**
+ * Set the price of this {@link NewSoda} instance.
+ *
+ * @param price The price of this {@link NewSoda}
+ */
+ public void setPrice( @Nonnull final Float price) {
+ this.price = price;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link NewSoda}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link NewSoda} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("NewSoda has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link NewSoda} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final NewSoda newSoda = (NewSoda) o;
+ return Objects.equals(this.cloudSdkCustomFields, newSoda.cloudSdkCustomFields) &&
+ Objects.equals(this.name, newSoda.name) &&
+ Objects.equals(this.brand, newSoda.brand) &&
+ Objects.equals(this.zero, newSoda.zero) &&
+ Objects.equals(this.since, newSoda.since) &&
+ Objects.equals(this.flavor, newSoda.flavor) &&
+ Objects.equals(this.price, newSoda.price);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, brand, zero, since, flavor, price, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class NewSoda {\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" brand: ").append(toIndentedString(brand)).append("\n");
+ sb.append(" zero: ").append(toIndentedString(zero)).append("\n");
+ sb.append(" since: ").append(toIndentedString(since)).append("\n");
+ sb.append(" flavor: ").append(toIndentedString(flavor)).append("\n");
+ sb.append(" price: ").append(toIndentedString(price)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/Soda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/Soda.java
new file mode 100644
index 000000000..86941bb48
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/Soda.java
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.services.builder.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * Soda
+ */
+// CHECKSTYLE:OFF
+public class Soda
+// CHECKSTYLE:ON
+{
+ @JsonProperty("id")
+ private Long id;
+
+ @JsonProperty("name")
+ private String name;
+
+ @JsonProperty("brand")
+ private String brand;
+
+ @JsonProperty("flavor")
+ private String flavor;
+
+ @JsonProperty("price")
+ private Float price;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the id of this {@link Soda} instance and return the same instance.
+ *
+ * @param id The id of this {@link Soda}
+ * @return The same instance of this {@link Soda} class
+ */
+ @Nonnull public Soda id( @Nullable final Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id The id of this {@link Soda} instance.
+ */
+ @Nonnull
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Set the id of this {@link Soda} instance.
+ *
+ * @param id The id of this {@link Soda}
+ */
+ public void setId( @Nullable final Long id) {
+ this.id = id;
+ }
+
+ /**
+ * Set the name of this {@link Soda} instance and return the same instance.
+ *
+ * @param name The name of this {@link Soda}
+ * @return The same instance of this {@link Soda} class
+ */
+ @Nonnull public Soda name( @Nonnull final String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name The name of this {@link Soda} instance.
+ */
+ @Nonnull
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the name of this {@link Soda} instance.
+ *
+ * @param name The name of this {@link Soda}
+ */
+ public void setName( @Nonnull final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set the brand of this {@link Soda} instance and return the same instance.
+ *
+ * @param brand The brand of this {@link Soda}
+ * @return The same instance of this {@link Soda} class
+ */
+ @Nonnull public Soda brand( @Nonnull final String brand) {
+ this.brand = brand;
+ return this;
+ }
+
+ /**
+ * Get brand
+ * @return brand The brand of this {@link Soda} instance.
+ */
+ @Nonnull
+ public String getBrand() {
+ return brand;
+ }
+
+ /**
+ * Set the brand of this {@link Soda} instance.
+ *
+ * @param brand The brand of this {@link Soda}
+ */
+ public void setBrand( @Nonnull final String brand) {
+ this.brand = brand;
+ }
+
+ /**
+ * Set the flavor of this {@link Soda} instance and return the same instance.
+ *
+ * @param flavor The flavor of this {@link Soda}
+ * @return The same instance of this {@link Soda} class
+ */
+ @Nonnull public Soda flavor( @Nonnull final String flavor) {
+ this.flavor = flavor;
+ return this;
+ }
+
+ /**
+ * Get flavor
+ * @return flavor The flavor of this {@link Soda} instance.
+ */
+ @Nonnull
+ public String getFlavor() {
+ return flavor;
+ }
+
+ /**
+ * Set the flavor of this {@link Soda} instance.
+ *
+ * @param flavor The flavor of this {@link Soda}
+ */
+ public void setFlavor( @Nonnull final String flavor) {
+ this.flavor = flavor;
+ }
+
+ /**
+ * Set the price of this {@link Soda} instance and return the same instance.
+ *
+ * @param price The price of this {@link Soda}
+ * @return The same instance of this {@link Soda} class
+ */
+ @Nonnull public Soda price( @Nonnull final Float price) {
+ this.price = price;
+ return this;
+ }
+
+ /**
+ * Get price
+ * @return price The price of this {@link Soda} instance.
+ */
+ @Nonnull
+ public Float getPrice() {
+ return price;
+ }
+
+ /**
+ * Set the price of this {@link Soda} instance.
+ *
+ * @param price The price of this {@link Soda}
+ */
+ public void setPrice( @Nonnull final Float price) {
+ this.price = price;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Soda}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Soda} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Soda has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Soda} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final Soda soda = (Soda) o;
+ return Objects.equals(this.cloudSdkCustomFields, soda.cloudSdkCustomFields) &&
+ Objects.equals(this.id, soda.id) &&
+ Objects.equals(this.name, soda.name) &&
+ Objects.equals(this.brand, soda.brand) &&
+ Objects.equals(this.flavor, soda.flavor) &&
+ Objects.equals(this.price, soda.price);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name, brand, flavor, price, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Soda {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" brand: ").append(toIndentedString(brand)).append("\n");
+ sb.append(" flavor: ").append(toIndentedString(flavor)).append("\n");
+ sb.append(" price: ").append(toIndentedString(price)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/UpdateSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/UpdateSoda.java
new file mode 100644
index 000000000..bad1c631c
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/UpdateSoda.java
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sap.cloud.sdk.services.builder.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.time.LocalDate;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * UpdateSoda
+ */
+// CHECKSTYLE:OFF
+public class UpdateSoda
+// CHECKSTYLE:ON
+{
+ @JsonProperty("name")
+ private String name;
+
+ @JsonProperty("zero")
+ private Boolean zero;
+
+ @JsonProperty("since")
+ private LocalDate since;
+
+ @JsonProperty("brand")
+ private String brand;
+
+ @JsonProperty("flavor")
+ private String flavor;
+
+ @JsonProperty("price")
+ private Float price;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the name of this {@link UpdateSoda} instance and return the same instance.
+ *
+ * @param name The name of this {@link UpdateSoda}
+ * @return The same instance of this {@link UpdateSoda} class
+ */
+ @Nonnull public UpdateSoda name( @Nullable final String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name The name of this {@link UpdateSoda} instance.
+ */
+ @Nonnull
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the name of this {@link UpdateSoda} instance.
+ *
+ * @param name The name of this {@link UpdateSoda}
+ */
+ public void setName( @Nullable final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set the zero of this {@link UpdateSoda} instance and return the same instance.
+ *
+ * @param zero The zero of this {@link UpdateSoda}
+ * @return The same instance of this {@link UpdateSoda} class
+ */
+ @Nonnull public UpdateSoda zero( @Nullable final Boolean zero) {
+ this.zero = zero;
+ return this;
+ }
+
+ /**
+ * Get zero
+ * @return zero The zero of this {@link UpdateSoda} instance.
+ */
+ @Nonnull
+ public Boolean isZero() {
+ return zero;
+ }
+
+ /**
+ * Set the zero of this {@link UpdateSoda} instance.
+ *
+ * @param zero The zero of this {@link UpdateSoda}
+ */
+ public void setZero( @Nullable final Boolean zero) {
+ this.zero = zero;
+ }
+
+ /**
+ * Set the since of this {@link UpdateSoda} instance and return the same instance.
+ *
+ * @param since The since of this {@link UpdateSoda}
+ * @return The same instance of this {@link UpdateSoda} class
+ */
+ @Nonnull public UpdateSoda since( @Nullable final LocalDate since) {
+ this.since = since;
+ return this;
+ }
+
+ /**
+ * Get since
+ * @return since The since of this {@link UpdateSoda} instance.
+ */
+ @Nonnull
+ public LocalDate getSince() {
+ return since;
+ }
+
+ /**
+ * Set the since of this {@link UpdateSoda} instance.
+ *
+ * @param since The since of this {@link UpdateSoda}
+ */
+ public void setSince( @Nullable final LocalDate since) {
+ this.since = since;
+ }
+
+ /**
+ * Set the brand of this {@link UpdateSoda} instance and return the same instance.
+ *
+ * @param brand The brand of this {@link UpdateSoda}
+ * @return The same instance of this {@link UpdateSoda} class
+ */
+ @Nonnull public UpdateSoda brand( @Nullable final String brand) {
+ this.brand = brand;
+ return this;
+ }
+
+ /**
+ * Get brand
+ * @return brand The brand of this {@link UpdateSoda} instance.
+ */
+ @Nonnull
+ public String getBrand() {
+ return brand;
+ }
+
+ /**
+ * Set the brand of this {@link UpdateSoda} instance.
+ *
+ * @param brand The brand of this {@link UpdateSoda}
+ */
+ public void setBrand( @Nullable final String brand) {
+ this.brand = brand;
+ }
+
+ /**
+ * Set the flavor of this {@link UpdateSoda} instance and return the same instance.
+ *
+ * @param flavor The flavor of this {@link UpdateSoda}
+ * @return The same instance of this {@link UpdateSoda} class
+ */
+ @Nonnull public UpdateSoda flavor( @Nullable final String flavor) {
+ this.flavor = flavor;
+ return this;
+ }
+
+ /**
+ * Get flavor
+ * @return flavor The flavor of this {@link UpdateSoda} instance.
+ */
+ @Nonnull
+ public String getFlavor() {
+ return flavor;
+ }
+
+ /**
+ * Set the flavor of this {@link UpdateSoda} instance.
+ *
+ * @param flavor The flavor of this {@link UpdateSoda}
+ */
+ public void setFlavor( @Nullable final String flavor) {
+ this.flavor = flavor;
+ }
+
+ /**
+ * Set the price of this {@link UpdateSoda} instance and return the same instance.
+ *
+ * @param price The price of this {@link UpdateSoda}
+ * @return The same instance of this {@link UpdateSoda} class
+ */
+ @Nonnull public UpdateSoda price( @Nullable final Float price) {
+ this.price = price;
+ return this;
+ }
+
+ /**
+ * Get price
+ * @return price The price of this {@link UpdateSoda} instance.
+ */
+ @Nonnull
+ public Float getPrice() {
+ return price;
+ }
+
+ /**
+ * Set the price of this {@link UpdateSoda} instance.
+ *
+ * @param price The price of this {@link UpdateSoda}
+ */
+ public void setPrice( @Nullable final Float price) {
+ this.price = price;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link UpdateSoda}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link UpdateSoda} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("UpdateSoda has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link UpdateSoda} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final UpdateSoda updateSoda = (UpdateSoda) o;
+ return Objects.equals(this.cloudSdkCustomFields, updateSoda.cloudSdkCustomFields) &&
+ Objects.equals(this.name, updateSoda.name) &&
+ Objects.equals(this.zero, updateSoda.zero) &&
+ Objects.equals(this.since, updateSoda.since) &&
+ Objects.equals(this.brand, updateSoda.brand) &&
+ Objects.equals(this.flavor, updateSoda.flavor) &&
+ Objects.equals(this.price, updateSoda.price);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, zero, since, brand, flavor, price, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class UpdateSoda {\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" zero: ").append(toIndentedString(zero)).append("\n");
+ sb.append(" since: ").append(toIndentedString(since)).append("\n");
+ sb.append(" brand: ").append(toIndentedString(brand)).append("\n");
+ sb.append(" flavor: ").append(toIndentedString(flavor)).append("\n");
+ sb.append(" price: ").append(toIndentedString(price)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java
index fcd71eef3..65ae0c16d 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java
@@ -16,11 +16,11 @@
package com.sap.cloud.sdk.services.apiclassvendorextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -28,12 +28,10 @@
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.time.LocalDate;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -82,7 +80,8 @@ public class NewSoda
* Get name
* @return name The name of this {@link NewSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -110,7 +109,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link NewSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -138,7 +138,8 @@ public void setBrand( @Nonnull final String brand) {
* Get zero
* @return zero The zero of this {@link NewSoda} instance.
*/
- @Nonnull public Boolean isZero() {
+ @Nonnull
+ public Boolean isZero() {
return zero;
}
@@ -166,7 +167,8 @@ public void setZero( @Nullable final Boolean zero) {
* Get since
* @return since The since of this {@link NewSoda} instance.
*/
- @Nonnull public LocalDate getSince() {
+ @Nonnull
+ public LocalDate getSince() {
return since;
}
@@ -194,7 +196,8 @@ public void setSince( @Nullable final LocalDate since) {
* Get flavor
* @return flavor The flavor of this {@link NewSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -222,7 +225,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link NewSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -321,6 +325,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java
index febbd2475..fb29e78ee 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.apiclassvendorextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -78,7 +76,8 @@ public class Soda
* Get id
* @return id The id of this {@link Soda} instance.
*/
- @Nonnull public Long getId() {
+ @Nonnull
+ public Long getId() {
return id;
}
@@ -106,7 +105,8 @@ public void setId( @Nullable final Long id) {
* Get name
* @return name The name of this {@link Soda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -134,7 +134,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link Soda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -162,7 +163,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link Soda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -190,7 +192,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link Soda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -287,6 +290,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java
index 0beed4af4..8a543cf92 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-json/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java
@@ -16,11 +16,11 @@
package com.sap.cloud.sdk.services.apiclassvendorextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -28,12 +28,10 @@
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.time.LocalDate;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -82,7 +80,8 @@ public class UpdateSoda
* Get name
* @return name The name of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -110,7 +109,8 @@ public void setName( @Nullable final String name) {
* Get zero
* @return zero The zero of this {@link UpdateSoda} instance.
*/
- @Nonnull public Boolean isZero() {
+ @Nonnull
+ public Boolean isZero() {
return zero;
}
@@ -138,7 +138,8 @@ public void setZero( @Nullable final Boolean zero) {
* Get since
* @return since The since of this {@link UpdateSoda} instance.
*/
- @Nonnull public LocalDate getSince() {
+ @Nonnull
+ public LocalDate getSince() {
return since;
}
@@ -166,7 +167,8 @@ public void setSince( @Nullable final LocalDate since) {
* Get brand
* @return brand The brand of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -194,7 +196,8 @@ public void setBrand( @Nullable final String brand) {
* Get flavor
* @return flavor The flavor of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -222,7 +225,8 @@ public void setFlavor( @Nullable final String flavor) {
* Get price
* @return price The price of this {@link UpdateSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -321,6 +325,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java
index ec3318c33..2622c27a6 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/NewSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.apiclassvendorextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -75,7 +73,8 @@ public class NewSoda
* Get name
* @return name The name of this {@link NewSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -103,7 +102,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link NewSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -131,7 +131,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link NewSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -159,7 +160,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link NewSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,6 +256,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java
index febbd2475..fb29e78ee 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/Soda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.apiclassvendorextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -78,7 +76,8 @@ public class Soda
* Get id
* @return id The id of this {@link Soda} instance.
*/
- @Nonnull public Long getId() {
+ @Nonnull
+ public Long getId() {
return id;
}
@@ -106,7 +105,8 @@ public void setId( @Nullable final Long id) {
* Get name
* @return name The name of this {@link Soda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -134,7 +134,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link Soda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -162,7 +163,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link Soda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -190,7 +192,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link Soda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -287,6 +290,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java
index cde2b37e7..28ab26bc0 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-vendor-extension-yaml/output/com/sap/cloud/sdk/services/apiclassvendorextension/model/UpdateSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.apiclassvendorextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -75,7 +73,8 @@ public class UpdateSoda
* Get name
* @return name The name of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -103,7 +102,8 @@ public void setName( @Nullable final String name) {
* Get brand
* @return brand The brand of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -131,7 +131,8 @@ public void setBrand( @Nullable final String brand) {
* Get flavor
* @return flavor The flavor of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -159,7 +160,8 @@ public void setFlavor( @Nullable final String flavor) {
* Get price
* @return price The price of this {@link UpdateSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,6 +256,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/input/sodastore.yaml b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/input/sodastore.yaml
new file mode 100644
index 000000000..470276795
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/input/sodastore.yaml
@@ -0,0 +1,58 @@
+openapi: 3.0.0
+info:
+ title: Soda Store API
+ version: 1.0.0
+ description: API for managing sodas in a soda store
+paths:
+ /sodas:
+ get:
+ summary: Get a list of all sodas
+ operationId: getSodas
+ responses:
+ '200':
+ description: A list of sodas
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/OneOf'
+components:
+ schemas:
+ OneOfWithDiscriminatorAndMapping:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ mapping:
+ Cola: '#/components/schemas/Cola'
+ Fanta: '#/components/schemas/Fanta'
+ OneOfWithDiscriminator:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ OneOf:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AnyOf:
+ anyOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AllOf:
+ allOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ Cola:
+ type: object
+ properties:
+ sodaType:
+ type: string
+ Fanta:
+ type: object
+ properties:
+ sodaType:
+ type: string
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/RootObject.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/AllOf.java
similarity index 57%
rename from datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/RootObject.java
rename to datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/AllOf.java
index ab58f486e..a2c60509f 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/RootObject.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/AllOf.java
@@ -3,8 +3,8 @@
*/
/*
- * Sample API
- * API for managing root and child objects
+ * Soda Store API
+ * API for managing sodas in a soda store
*
* The version of the OpenAPI document: 1.0.0
*
@@ -14,89 +14,72 @@
* Do not edit the class manually.
*/
-package com.sap.cloud.sdk.services.anyofoneof.model;
+package test;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import com.sap.cloud.sdk.services.anyofoneof.model.RootObjectQuestionsInner;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
- * RootObject
+ * AllOf
*/
// CHECKSTYLE:OFF
-public class RootObject
+public class AllOf
// CHECKSTYLE:ON
{
- @JsonProperty("questions")
- private List questions = new ArrayList<>();
+ @JsonProperty("sodaType")
+ private String sodaType;
@JsonAnySetter
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
/**
- * Set the questions of this {@link RootObject} instance and return the same instance.
+ * Set the sodaType of this {@link AllOf} instance and return the same instance.
*
- * @param questions The questions of this {@link RootObject}
- * @return The same instance of this {@link RootObject} class
+ * @param sodaType The sodaType of this {@link AllOf}
+ * @return The same instance of this {@link AllOf} class
*/
- @Nonnull public RootObject questions( @Nullable final List questions) {
- this.questions = questions;
- return this;
- }
- /**
- * Add one questions instance to this {@link RootObject}.
- * @param questionsItem The questions that should be added
- * @return The same instance of type {@link RootObject}
- */
- @Nonnull public RootObject addQuestionsItem( @Nonnull final RootObjectQuestionsInner questionsItem) {
- if (this.questions == null) {
- this.questions = new ArrayList<>();
- }
- this.questions.add(questionsItem);
+ @Nonnull public AllOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
return this;
}
/**
- * Get questions
- * @return questions The questions of this {@link RootObject} instance.
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link AllOf} instance.
*/
- @Nonnull public List getQuestions() {
- return questions;
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
}
/**
- * Set the questions of this {@link RootObject} instance.
+ * Set the sodaType of this {@link AllOf} instance.
*
- * @param questions The questions of this {@link RootObject}
+ * @param sodaType The sodaType of this {@link AllOf}
*/
- public void setQuestions( @Nullable final List questions) {
- this.questions = questions;
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
}
/**
- * Get the names of the unrecognizable properties of the {@link RootObject}.
+ * Get the names of the unrecognizable properties of the {@link AllOf}.
* @return The set of properties names
*/
@JsonIgnore
@@ -106,7 +89,7 @@ public Set getCustomFieldNames() {
}
/**
- * Get the value of an unrecognizable property of this {@link RootObject} instance.
+ * Get the value of an unrecognizable property of this {@link AllOf} instance.
* @param name The name of the property
* @return The value of the property
* @throws NoSuchElementException If no property with the given name could be found.
@@ -114,13 +97,13 @@ public Set getCustomFieldNames() {
@Nullable
public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
if( !cloudSdkCustomFields.containsKey(name) ) {
- throw new NoSuchElementException("RootObject has no field with name '" + name + "'.");
+ throw new NoSuchElementException("AllOf has no field with name '" + name + "'.");
}
return cloudSdkCustomFields.get(name);
}
/**
- * Set an unrecognizable property of this {@link RootObject} instance. If the map previously contained a mapping
+ * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained a mapping
* for the key, the old value is replaced by the specified value.
* @param customFieldName The name of the property
* @param customFieldValue The value of the property
@@ -140,21 +123,21 @@ public boolean equals(@Nullable final java.lang.Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- final RootObject rootObject = (RootObject) o;
- return Objects.equals(this.cloudSdkCustomFields, rootObject.cloudSdkCustomFields) &&
- Objects.equals(this.questions, rootObject.questions);
+ final AllOf allOf = (AllOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, allOf.sodaType);
}
@Override
public int hashCode() {
- return Objects.hash(questions, cloudSdkCustomFields);
+ return Objects.hash(sodaType, cloudSdkCustomFields);
}
@Override
@Nonnull public String toString() {
final StringBuilder sb = new StringBuilder();
- sb.append("class RootObject {\n");
- sb.append(" questions: ").append(toIndentedString(questions)).append("\n");
+ sb.append("class AllOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
sb.append("}");
return sb.toString();
@@ -171,6 +154,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/AnyOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/AnyOf.java
new file mode 100644
index 000000000..879569438
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/AnyOf.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * AnyOf
+ */
+// CHECKSTYLE:OFF
+public class AnyOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link AnyOf}
+ * @return The same instance of this {@link AnyOf} class
+ */
+ @Nonnull public AnyOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link AnyOf} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance.
+ *
+ * @param sodaType The sodaType of this {@link AnyOf}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link AnyOf}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link AnyOf} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("AnyOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final AnyOf anyOf = (AnyOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, anyOf.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class AnyOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/Cola.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/Cola.java
new file mode 100644
index 000000000..a2adbf686
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/Cola.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * Cola
+ */
+// CHECKSTYLE:OFF
+public class Cola
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link Cola} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link Cola}
+ * @return The same instance of this {@link Cola} class
+ */
+ @Nonnull public Cola sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link Cola} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Cola} instance.
+ *
+ * @param sodaType The sodaType of this {@link Cola}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Cola}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Cola} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Cola has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final Cola cola = (Cola) o;
+ return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, cola.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Cola {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/Fanta.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/Fanta.java
new file mode 100644
index 000000000..c6359bba1
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/Fanta.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * Fanta
+ */
+// CHECKSTYLE:OFF
+public class Fanta
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link Fanta}
+ * @return The same instance of this {@link Fanta} class
+ */
+ @Nonnull public Fanta sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link Fanta} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance.
+ *
+ * @param sodaType The sodaType of this {@link Fanta}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Fanta}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Fanta} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Fanta has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final Fanta fanta = (Fanta) o;
+ return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, fanta.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Fanta {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOf.java
new file mode 100644
index 000000000..7ad1e3e0a
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOf.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOf
+ */
+// CHECKSTYLE:OFF
+public class OneOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link OneOf} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOf}
+ * @return The same instance of this {@link OneOf} class
+ */
+ @Nonnull public OneOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link OneOf} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link OneOf} instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOf}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link OneOf}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link OneOf} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("OneOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link OneOf} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final OneOf oneOf = (OneOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, oneOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, oneOf.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class OneOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOfWithDiscriminator.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOfWithDiscriminator.java
new file mode 100644
index 000000000..883ee607c
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOfWithDiscriminator.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOfWithDiscriminator
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = Cola.class, name = "Cola"),
+ @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"),
+})
+// CHECKSTYLE:OFF
+public class OneOfWithDiscriminator
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminator} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminator}
+ * @return The same instance of this {@link OneOfWithDiscriminator} class
+ */
+ @Nonnull public OneOfWithDiscriminator sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link OneOfWithDiscriminator} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminator} instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminator}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link OneOfWithDiscriminator}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link OneOfWithDiscriminator} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("OneOfWithDiscriminator has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link OneOfWithDiscriminator} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final OneOfWithDiscriminator oneOfWithDiscriminator = (OneOfWithDiscriminator) o;
+ return Objects.equals(this.cloudSdkCustomFields, oneOfWithDiscriminator.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, oneOfWithDiscriminator.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class OneOfWithDiscriminator {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOfWithDiscriminatorAndMapping.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOfWithDiscriminatorAndMapping.java
new file mode 100644
index 000000000..f5f8c4ebc
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/generate-apis/output/test/OneOfWithDiscriminatorAndMapping.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOfWithDiscriminatorAndMapping
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = Cola.class, name = "Cola"),
+ @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"),
+})
+// CHECKSTYLE:OFF
+public class OneOfWithDiscriminatorAndMapping
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminatorAndMapping} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminatorAndMapping}
+ * @return The same instance of this {@link OneOfWithDiscriminatorAndMapping} class
+ */
+ @Nonnull public OneOfWithDiscriminatorAndMapping sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link OneOfWithDiscriminatorAndMapping} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminatorAndMapping} instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminatorAndMapping}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link OneOfWithDiscriminatorAndMapping}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link OneOfWithDiscriminatorAndMapping} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("OneOfWithDiscriminatorAndMapping has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link OneOfWithDiscriminatorAndMapping} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final OneOfWithDiscriminatorAndMapping oneOfWithDiscriminatorAndMapping = (OneOfWithDiscriminatorAndMapping) o;
+ return Objects.equals(this.cloudSdkCustomFields, oneOfWithDiscriminatorAndMapping.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, oneOfWithDiscriminatorAndMapping.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class OneOfWithDiscriminatorAndMapping {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/input/AggregatorNestedSchemaChild.json b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/input/AggregatorNestedSchemaChild.json
deleted file mode 100644
index bfa73118b..000000000
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/input/AggregatorNestedSchemaChild.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "x-sap-api-type": "REST",
- "x-sap-shortText": "This is a sample API to test the Cloud SDK's OpenAPI generator.",
- "x-sap-stateInfo": {
- "state": "Active"
- },
- "openapi": "3.0.3",
- "info": {
- "title": "Sample API",
- "version": "1.0.0",
- "description": "API for managing root and child objects"
- },
- "paths": {
- "/some/endpoint": {
- "post": {
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RootObject"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Something was created.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RootObject"
- }
- }
- }
- },
- "400": {
- "description": "Request was invalid."
- },
- "401": {
- "description": "Authentication Error"
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "RootObject": {
- "type": "object",
- "properties": {
- "questions": {
- "type": "array",
- "items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/ChildObject1"
- },
- {
- "$ref": "#/components/schemas/ChildObject2"
- },
- {
- "$ref": "#/components/schemas/ChildObject3"
- }
- ]
- }
- }
- }
- },
- "ChildObject1": {
- "allOf": [
- {
- "$ref": "#/components/schemas/NestedChildObject"
- },
- {
- "type": "string"
- }
- ]
- },
- "ChildObject2": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/NestedChildObject"
- },
- {
- "type": "string"
- }
- ]
- },
- "ChildObject3": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/NestedChildObject"
- },
- {
- "type": "string"
- }
- ]
- },
- "NestedChildObject": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "type": {
- "type": "string"
- },
- "text": {
- "type": "string"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject1.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject1.java
deleted file mode 100644
index cc169338f..000000000
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject1.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
- */
-
-/*
- * Sample API
- * API for managing root and child objects
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-package com.sap.cloud.sdk.services.anyofoneof.model;
-
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.Set;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-/**
- * ChildObject1
- */
-// CHECKSTYLE:OFF
-public class ChildObject1
-// CHECKSTYLE:ON
-{
- @JsonProperty("id")
- private String id;
-
- @JsonProperty("type")
- private String type;
-
- @JsonProperty("text")
- private String text;
-
- @JsonAnySetter
- @JsonAnyGetter
- private final Map cloudSdkCustomFields = new LinkedHashMap<>();
-
- /**
- * Set the id of this {@link ChildObject1} instance and return the same instance.
- *
- * @param id The id of this {@link ChildObject1}
- * @return The same instance of this {@link ChildObject1} class
- */
- @Nonnull public ChildObject1 id( @Nullable final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id The id of this {@link ChildObject1} instance.
- */
- @Nonnull public String getId() {
- return id;
- }
-
- /**
- * Set the id of this {@link ChildObject1} instance.
- *
- * @param id The id of this {@link ChildObject1}
- */
- public void setId( @Nullable final String id) {
- this.id = id;
- }
-
- /**
- * Set the type of this {@link ChildObject1} instance and return the same instance.
- *
- * @param type The type of this {@link ChildObject1}
- * @return The same instance of this {@link ChildObject1} class
- */
- @Nonnull public ChildObject1 type( @Nullable final String type) {
- this.type = type;
- return this;
- }
-
- /**
- * Get type
- * @return type The type of this {@link ChildObject1} instance.
- */
- @Nonnull public String getType() {
- return type;
- }
-
- /**
- * Set the type of this {@link ChildObject1} instance.
- *
- * @param type The type of this {@link ChildObject1}
- */
- public void setType( @Nullable final String type) {
- this.type = type;
- }
-
- /**
- * Set the text of this {@link ChildObject1} instance and return the same instance.
- *
- * @param text The text of this {@link ChildObject1}
- * @return The same instance of this {@link ChildObject1} class
- */
- @Nonnull public ChildObject1 text( @Nullable final String text) {
- this.text = text;
- return this;
- }
-
- /**
- * Get text
- * @return text The text of this {@link ChildObject1} instance.
- */
- @Nonnull public String getText() {
- return text;
- }
-
- /**
- * Set the text of this {@link ChildObject1} instance.
- *
- * @param text The text of this {@link ChildObject1}
- */
- public void setText( @Nullable final String text) {
- this.text = text;
- }
-
- /**
- * Get the names of the unrecognizable properties of the {@link ChildObject1}.
- * @return The set of properties names
- */
- @JsonIgnore
- @Nonnull
- public Set getCustomFieldNames() {
- return cloudSdkCustomFields.keySet();
- }
-
- /**
- * Get the value of an unrecognizable property of this {@link ChildObject1} instance.
- * @param name The name of the property
- * @return The value of the property
- * @throws NoSuchElementException If no property with the given name could be found.
- */
- @Nullable
- public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
- if( !cloudSdkCustomFields.containsKey(name) ) {
- throw new NoSuchElementException("ChildObject1 has no field with name '" + name + "'.");
- }
- return cloudSdkCustomFields.get(name);
- }
-
- /**
- * Set an unrecognizable property of this {@link ChildObject1} instance. If the map previously contained a mapping
- * for the key, the old value is replaced by the specified value.
- * @param customFieldName The name of the property
- * @param customFieldValue The value of the property
- */
- @JsonIgnore
- public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
- {
- cloudSdkCustomFields.put(customFieldName, customFieldValue);
- }
-
-
- @Override
- public boolean equals(@Nullable final java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final ChildObject1 childObject1 = (ChildObject1) o;
- return Objects.equals(this.cloudSdkCustomFields, childObject1.cloudSdkCustomFields) &&
- Objects.equals(this.id, childObject1.id) &&
- Objects.equals(this.type, childObject1.type) &&
- Objects.equals(this.text, childObject1.text);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, type, text, cloudSdkCustomFields);
- }
-
- @Override
- @Nonnull public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("class ChildObject1 {\n");
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" type: ").append(toIndentedString(type)).append("\n");
- sb.append(" text: ").append(toIndentedString(text)).append("\n");
- cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(final java.lang.Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-
-
-}
-
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject2.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject2.java
deleted file mode 100644
index 32affc7cc..000000000
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject2.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
- */
-
-/*
- * Sample API
- * API for managing root and child objects
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-package com.sap.cloud.sdk.services.anyofoneof.model;
-
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.Set;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.sap.cloud.sdk.services.anyofoneof.model.NestedChildObject;
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-/**
- * ChildObject2
- */
-// CHECKSTYLE:OFF
-public class ChildObject2
-// CHECKSTYLE:ON
-{
- @JsonProperty("id")
- private String id;
-
- @JsonProperty("type")
- private String type;
-
- @JsonProperty("text")
- private String text;
-
- @JsonAnySetter
- @JsonAnyGetter
- private final Map cloudSdkCustomFields = new LinkedHashMap<>();
-
- /**
- * Set the id of this {@link ChildObject2} instance and return the same instance.
- *
- * @param id The id of this {@link ChildObject2}
- * @return The same instance of this {@link ChildObject2} class
- */
- @Nonnull public ChildObject2 id( @Nullable final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id The id of this {@link ChildObject2} instance.
- */
- @Nonnull public String getId() {
- return id;
- }
-
- /**
- * Set the id of this {@link ChildObject2} instance.
- *
- * @param id The id of this {@link ChildObject2}
- */
- public void setId( @Nullable final String id) {
- this.id = id;
- }
-
- /**
- * Set the type of this {@link ChildObject2} instance and return the same instance.
- *
- * @param type The type of this {@link ChildObject2}
- * @return The same instance of this {@link ChildObject2} class
- */
- @Nonnull public ChildObject2 type( @Nullable final String type) {
- this.type = type;
- return this;
- }
-
- /**
- * Get type
- * @return type The type of this {@link ChildObject2} instance.
- */
- @Nonnull public String getType() {
- return type;
- }
-
- /**
- * Set the type of this {@link ChildObject2} instance.
- *
- * @param type The type of this {@link ChildObject2}
- */
- public void setType( @Nullable final String type) {
- this.type = type;
- }
-
- /**
- * Set the text of this {@link ChildObject2} instance and return the same instance.
- *
- * @param text The text of this {@link ChildObject2}
- * @return The same instance of this {@link ChildObject2} class
- */
- @Nonnull public ChildObject2 text( @Nullable final String text) {
- this.text = text;
- return this;
- }
-
- /**
- * Get text
- * @return text The text of this {@link ChildObject2} instance.
- */
- @Nonnull public String getText() {
- return text;
- }
-
- /**
- * Set the text of this {@link ChildObject2} instance.
- *
- * @param text The text of this {@link ChildObject2}
- */
- public void setText( @Nullable final String text) {
- this.text = text;
- }
-
- /**
- * Get the names of the unrecognizable properties of the {@link ChildObject2}.
- * @return The set of properties names
- */
- @JsonIgnore
- @Nonnull
- public Set getCustomFieldNames() {
- return cloudSdkCustomFields.keySet();
- }
-
- /**
- * Get the value of an unrecognizable property of this {@link ChildObject2} instance.
- * @param name The name of the property
- * @return The value of the property
- * @throws NoSuchElementException If no property with the given name could be found.
- */
- @Nullable
- public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
- if( !cloudSdkCustomFields.containsKey(name) ) {
- throw new NoSuchElementException("ChildObject2 has no field with name '" + name + "'.");
- }
- return cloudSdkCustomFields.get(name);
- }
-
- /**
- * Set an unrecognizable property of this {@link ChildObject2} instance. If the map previously contained a mapping
- * for the key, the old value is replaced by the specified value.
- * @param customFieldName The name of the property
- * @param customFieldValue The value of the property
- */
- @JsonIgnore
- public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
- {
- cloudSdkCustomFields.put(customFieldName, customFieldValue);
- }
-
-
- @Override
- public boolean equals(@Nullable final java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final ChildObject2 childObject2 = (ChildObject2) o;
- return Objects.equals(this.cloudSdkCustomFields, childObject2.cloudSdkCustomFields) &&
- Objects.equals(this.id, childObject2.id) &&
- Objects.equals(this.type, childObject2.type) &&
- Objects.equals(this.text, childObject2.text);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, type, text, cloudSdkCustomFields);
- }
-
- @Override
- @Nonnull public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("class ChildObject2 {\n");
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" type: ").append(toIndentedString(type)).append("\n");
- sb.append(" text: ").append(toIndentedString(text)).append("\n");
- cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(final java.lang.Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-
-
-}
-
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject3.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject3.java
deleted file mode 100644
index 1d5f13a2b..000000000
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/ChildObject3.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
- */
-
-/*
- * Sample API
- * API for managing root and child objects
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-package com.sap.cloud.sdk.services.anyofoneof.model;
-
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.Set;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.sap.cloud.sdk.services.anyofoneof.model.NestedChildObject;
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-/**
- * ChildObject3
- */
-// CHECKSTYLE:OFF
-public class ChildObject3
-// CHECKSTYLE:ON
-{
- @JsonProperty("id")
- private String id;
-
- @JsonProperty("type")
- private String type;
-
- @JsonProperty("text")
- private String text;
-
- @JsonAnySetter
- @JsonAnyGetter
- private final Map cloudSdkCustomFields = new LinkedHashMap<>();
-
- /**
- * Set the id of this {@link ChildObject3} instance and return the same instance.
- *
- * @param id The id of this {@link ChildObject3}
- * @return The same instance of this {@link ChildObject3} class
- */
- @Nonnull public ChildObject3 id( @Nullable final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id The id of this {@link ChildObject3} instance.
- */
- @Nonnull public String getId() {
- return id;
- }
-
- /**
- * Set the id of this {@link ChildObject3} instance.
- *
- * @param id The id of this {@link ChildObject3}
- */
- public void setId( @Nullable final String id) {
- this.id = id;
- }
-
- /**
- * Set the type of this {@link ChildObject3} instance and return the same instance.
- *
- * @param type The type of this {@link ChildObject3}
- * @return The same instance of this {@link ChildObject3} class
- */
- @Nonnull public ChildObject3 type( @Nullable final String type) {
- this.type = type;
- return this;
- }
-
- /**
- * Get type
- * @return type The type of this {@link ChildObject3} instance.
- */
- @Nonnull public String getType() {
- return type;
- }
-
- /**
- * Set the type of this {@link ChildObject3} instance.
- *
- * @param type The type of this {@link ChildObject3}
- */
- public void setType( @Nullable final String type) {
- this.type = type;
- }
-
- /**
- * Set the text of this {@link ChildObject3} instance and return the same instance.
- *
- * @param text The text of this {@link ChildObject3}
- * @return The same instance of this {@link ChildObject3} class
- */
- @Nonnull public ChildObject3 text( @Nullable final String text) {
- this.text = text;
- return this;
- }
-
- /**
- * Get text
- * @return text The text of this {@link ChildObject3} instance.
- */
- @Nonnull public String getText() {
- return text;
- }
-
- /**
- * Set the text of this {@link ChildObject3} instance.
- *
- * @param text The text of this {@link ChildObject3}
- */
- public void setText( @Nullable final String text) {
- this.text = text;
- }
-
- /**
- * Get the names of the unrecognizable properties of the {@link ChildObject3}.
- * @return The set of properties names
- */
- @JsonIgnore
- @Nonnull
- public Set getCustomFieldNames() {
- return cloudSdkCustomFields.keySet();
- }
-
- /**
- * Get the value of an unrecognizable property of this {@link ChildObject3} instance.
- * @param name The name of the property
- * @return The value of the property
- * @throws NoSuchElementException If no property with the given name could be found.
- */
- @Nullable
- public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
- if( !cloudSdkCustomFields.containsKey(name) ) {
- throw new NoSuchElementException("ChildObject3 has no field with name '" + name + "'.");
- }
- return cloudSdkCustomFields.get(name);
- }
-
- /**
- * Set an unrecognizable property of this {@link ChildObject3} instance. If the map previously contained a mapping
- * for the key, the old value is replaced by the specified value.
- * @param customFieldName The name of the property
- * @param customFieldValue The value of the property
- */
- @JsonIgnore
- public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
- {
- cloudSdkCustomFields.put(customFieldName, customFieldValue);
- }
-
-
- @Override
- public boolean equals(@Nullable final java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final ChildObject3 childObject3 = (ChildObject3) o;
- return Objects.equals(this.cloudSdkCustomFields, childObject3.cloudSdkCustomFields) &&
- Objects.equals(this.id, childObject3.id) &&
- Objects.equals(this.type, childObject3.type) &&
- Objects.equals(this.text, childObject3.text);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, type, text, cloudSdkCustomFields);
- }
-
- @Override
- @Nonnull public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("class ChildObject3 {\n");
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" type: ").append(toIndentedString(type)).append("\n");
- sb.append(" text: ").append(toIndentedString(text)).append("\n");
- cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(final java.lang.Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-
-
-}
-
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/NestedChildObject.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/NestedChildObject.java
deleted file mode 100644
index a63891588..000000000
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/NestedChildObject.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
- */
-
-/*
- * Sample API
- * API for managing root and child objects
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-package com.sap.cloud.sdk.services.anyofoneof.model;
-
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.Set;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-/**
- * NestedChildObject
- */
-// CHECKSTYLE:OFF
-public class NestedChildObject
-// CHECKSTYLE:ON
-{
- @JsonProperty("id")
- private String id;
-
- @JsonProperty("type")
- private String type;
-
- @JsonProperty("text")
- private String text;
-
- @JsonAnySetter
- @JsonAnyGetter
- private final Map cloudSdkCustomFields = new LinkedHashMap<>();
-
- /**
- * Set the id of this {@link NestedChildObject} instance and return the same instance.
- *
- * @param id The id of this {@link NestedChildObject}
- * @return The same instance of this {@link NestedChildObject} class
- */
- @Nonnull public NestedChildObject id( @Nullable final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id The id of this {@link NestedChildObject} instance.
- */
- @Nonnull public String getId() {
- return id;
- }
-
- /**
- * Set the id of this {@link NestedChildObject} instance.
- *
- * @param id The id of this {@link NestedChildObject}
- */
- public void setId( @Nullable final String id) {
- this.id = id;
- }
-
- /**
- * Set the type of this {@link NestedChildObject} instance and return the same instance.
- *
- * @param type The type of this {@link NestedChildObject}
- * @return The same instance of this {@link NestedChildObject} class
- */
- @Nonnull public NestedChildObject type( @Nullable final String type) {
- this.type = type;
- return this;
- }
-
- /**
- * Get type
- * @return type The type of this {@link NestedChildObject} instance.
- */
- @Nonnull public String getType() {
- return type;
- }
-
- /**
- * Set the type of this {@link NestedChildObject} instance.
- *
- * @param type The type of this {@link NestedChildObject}
- */
- public void setType( @Nullable final String type) {
- this.type = type;
- }
-
- /**
- * Set the text of this {@link NestedChildObject} instance and return the same instance.
- *
- * @param text The text of this {@link NestedChildObject}
- * @return The same instance of this {@link NestedChildObject} class
- */
- @Nonnull public NestedChildObject text( @Nullable final String text) {
- this.text = text;
- return this;
- }
-
- /**
- * Get text
- * @return text The text of this {@link NestedChildObject} instance.
- */
- @Nonnull public String getText() {
- return text;
- }
-
- /**
- * Set the text of this {@link NestedChildObject} instance.
- *
- * @param text The text of this {@link NestedChildObject}
- */
- public void setText( @Nullable final String text) {
- this.text = text;
- }
-
- /**
- * Get the names of the unrecognizable properties of the {@link NestedChildObject}.
- * @return The set of properties names
- */
- @JsonIgnore
- @Nonnull
- public Set getCustomFieldNames() {
- return cloudSdkCustomFields.keySet();
- }
-
- /**
- * Get the value of an unrecognizable property of this {@link NestedChildObject} instance.
- * @param name The name of the property
- * @return The value of the property
- * @throws NoSuchElementException If no property with the given name could be found.
- */
- @Nullable
- public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
- if( !cloudSdkCustomFields.containsKey(name) ) {
- throw new NoSuchElementException("NestedChildObject has no field with name '" + name + "'.");
- }
- return cloudSdkCustomFields.get(name);
- }
-
- /**
- * Set an unrecognizable property of this {@link NestedChildObject} instance. If the map previously contained a mapping
- * for the key, the old value is replaced by the specified value.
- * @param customFieldName The name of the property
- * @param customFieldValue The value of the property
- */
- @JsonIgnore
- public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
- {
- cloudSdkCustomFields.put(customFieldName, customFieldValue);
- }
-
-
- @Override
- public boolean equals(@Nullable final java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final NestedChildObject nestedChildObject = (NestedChildObject) o;
- return Objects.equals(this.cloudSdkCustomFields, nestedChildObject.cloudSdkCustomFields) &&
- Objects.equals(this.id, nestedChildObject.id) &&
- Objects.equals(this.type, nestedChildObject.type) &&
- Objects.equals(this.text, nestedChildObject.text);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, type, text, cloudSdkCustomFields);
- }
-
- @Override
- @Nonnull public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("class NestedChildObject {\n");
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" type: ").append(toIndentedString(type)).append("\n");
- sb.append(" text: ").append(toIndentedString(text)).append("\n");
- cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(final java.lang.Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-
-
-}
-
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/RootObjectQuestionsInner.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/RootObjectQuestionsInner.java
deleted file mode 100644
index c3dd8933e..000000000
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/model/RootObjectQuestionsInner.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
- */
-
-/*
- * Sample API
- * API for managing root and child objects
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-package com.sap.cloud.sdk.services.anyofoneof.model;
-
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.Set;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.sap.cloud.sdk.services.anyofoneof.model.ChildObject1;
-import com.sap.cloud.sdk.services.anyofoneof.model.ChildObject2;
-import com.sap.cloud.sdk.services.anyofoneof.model.ChildObject3;
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-/**
- * RootObjectQuestionsInner
- */
-// CHECKSTYLE:OFF
-public class RootObjectQuestionsInner
-// CHECKSTYLE:ON
-{
- @JsonProperty("id")
- private String id;
-
- @JsonProperty("type")
- private String type;
-
- @JsonProperty("text")
- private String text;
-
- @JsonAnySetter
- @JsonAnyGetter
- private final Map cloudSdkCustomFields = new LinkedHashMap<>();
-
- /**
- * Set the id of this {@link RootObjectQuestionsInner} instance and return the same instance.
- *
- * @param id The id of this {@link RootObjectQuestionsInner}
- * @return The same instance of this {@link RootObjectQuestionsInner} class
- */
- @Nonnull public RootObjectQuestionsInner id( @Nullable final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id The id of this {@link RootObjectQuestionsInner} instance.
- */
- @Nonnull public String getId() {
- return id;
- }
-
- /**
- * Set the id of this {@link RootObjectQuestionsInner} instance.
- *
- * @param id The id of this {@link RootObjectQuestionsInner}
- */
- public void setId( @Nullable final String id) {
- this.id = id;
- }
-
- /**
- * Set the type of this {@link RootObjectQuestionsInner} instance and return the same instance.
- *
- * @param type The type of this {@link RootObjectQuestionsInner}
- * @return The same instance of this {@link RootObjectQuestionsInner} class
- */
- @Nonnull public RootObjectQuestionsInner type( @Nullable final String type) {
- this.type = type;
- return this;
- }
-
- /**
- * Get type
- * @return type The type of this {@link RootObjectQuestionsInner} instance.
- */
- @Nonnull public String getType() {
- return type;
- }
-
- /**
- * Set the type of this {@link RootObjectQuestionsInner} instance.
- *
- * @param type The type of this {@link RootObjectQuestionsInner}
- */
- public void setType( @Nullable final String type) {
- this.type = type;
- }
-
- /**
- * Set the text of this {@link RootObjectQuestionsInner} instance and return the same instance.
- *
- * @param text The text of this {@link RootObjectQuestionsInner}
- * @return The same instance of this {@link RootObjectQuestionsInner} class
- */
- @Nonnull public RootObjectQuestionsInner text( @Nullable final String text) {
- this.text = text;
- return this;
- }
-
- /**
- * Get text
- * @return text The text of this {@link RootObjectQuestionsInner} instance.
- */
- @Nonnull public String getText() {
- return text;
- }
-
- /**
- * Set the text of this {@link RootObjectQuestionsInner} instance.
- *
- * @param text The text of this {@link RootObjectQuestionsInner}
- */
- public void setText( @Nullable final String text) {
- this.text = text;
- }
-
- /**
- * Get the names of the unrecognizable properties of the {@link RootObjectQuestionsInner}.
- * @return The set of properties names
- */
- @JsonIgnore
- @Nonnull
- public Set getCustomFieldNames() {
- return cloudSdkCustomFields.keySet();
- }
-
- /**
- * Get the value of an unrecognizable property of this {@link RootObjectQuestionsInner} instance.
- * @param name The name of the property
- * @return The value of the property
- * @throws NoSuchElementException If no property with the given name could be found.
- */
- @Nullable
- public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
- if( !cloudSdkCustomFields.containsKey(name) ) {
- throw new NoSuchElementException("RootObjectQuestionsInner has no field with name '" + name + "'.");
- }
- return cloudSdkCustomFields.get(name);
- }
-
- /**
- * Set an unrecognizable property of this {@link RootObjectQuestionsInner} instance. If the map previously contained a mapping
- * for the key, the old value is replaced by the specified value.
- * @param customFieldName The name of the property
- * @param customFieldValue The value of the property
- */
- @JsonIgnore
- public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
- {
- cloudSdkCustomFields.put(customFieldName, customFieldValue);
- }
-
-
- @Override
- public boolean equals(@Nullable final java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final RootObjectQuestionsInner rootObjectQuestionsInner = (RootObjectQuestionsInner) o;
- return Objects.equals(this.cloudSdkCustomFields, rootObjectQuestionsInner.cloudSdkCustomFields) &&
- Objects.equals(this.id, rootObjectQuestionsInner.id) &&
- Objects.equals(this.type, rootObjectQuestionsInner.type) &&
- Objects.equals(this.text, rootObjectQuestionsInner.text);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, type, text, cloudSdkCustomFields);
- }
-
- @Override
- @Nonnull public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("class RootObjectQuestionsInner {\n");
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" type: ").append(toIndentedString(type)).append("\n");
- sb.append(" text: ").append(toIndentedString(text)).append("\n");
- cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(final java.lang.Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-
-
-}
-
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/NewSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/NewSoda.java
index 42f23868b..7f740af26 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/NewSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/NewSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.builder.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -59,6 +57,9 @@ public class NewSoda
@JsonAnySetter
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+ /**
+ * Default constructor for NewSoda.
+ */
private NewSoda() { }
/**
@@ -76,7 +77,8 @@ private NewSoda() { }
* Get name
* @return name The name of this {@link NewSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -104,7 +106,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link NewSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -132,7 +135,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link NewSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -160,7 +164,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link NewSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,7 +259,6 @@ private String toIndentedString(final java.lang.Object o) {
}
return o.toString().replace("\n", "\n ");
}
-
/**
* Create a type-safe, fluent-api builder object to construct a new {@link NewSoda} instance with all required arguments.
*/
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/Soda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/Soda.java
index 2dd81618e..5bcf303da 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/Soda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/Soda.java
@@ -16,11 +16,11 @@
package com.sap.cloud.sdk.services.builder.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -30,12 +30,10 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -65,6 +63,9 @@ public class Soda
@JsonAnySetter
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+ /**
+ * Default constructor for Soda.
+ */
private Soda() { }
/**
@@ -82,7 +83,8 @@ private Soda() { }
* Get id
* @return id The id of this {@link Soda} instance.
*/
- @Nonnull public Long getId() {
+ @Nonnull
+ public Long getId() {
return id;
}
@@ -110,7 +112,8 @@ public void setId( @Nullable final Long id) {
* Get name
* @return name The name of this {@link Soda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -138,7 +141,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link Soda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -178,7 +182,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavors
* @return flavors The flavors of this {@link Soda} instance.
*/
- @Nonnull public List getFlavors() {
+ @Nonnull
+ public List getFlavors() {
return flavors;
}
@@ -206,7 +211,8 @@ public void setFlavors( @Nonnull final List flavors) {
* Get price
* @return price The price of this {@link Soda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -302,7 +308,6 @@ private String toIndentedString(final java.lang.Object o) {
}
return o.toString().replace("\n", "\n ");
}
-
/**
* Create a type-safe, fluent-api builder object to construct a new {@link Soda} instance with all required arguments.
*/
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/UpdateSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/UpdateSoda.java
index 248fe56bf..6cf426327 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/UpdateSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-builder/output/com/sap/cloud/sdk/services/builder/model/UpdateSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.builder.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -59,6 +57,9 @@ public class UpdateSoda
@JsonAnySetter
@JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+ /**
+ * Default constructor for UpdateSoda.
+ */
private UpdateSoda() { }
/**
@@ -76,7 +77,8 @@ private UpdateSoda() { }
* Get name
* @return name The name of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -104,7 +106,8 @@ public void setName( @Nullable final String name) {
* Get brand
* @return brand The brand of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -132,7 +135,8 @@ public void setBrand( @Nullable final String brand) {
* Get flavor
* @return flavor The flavor of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -160,7 +164,8 @@ public void setFlavor( @Nullable final String flavor) {
* Get price
* @return price The price of this {@link UpdateSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,7 +259,6 @@ private String toIndentedString(final java.lang.Object o) {
}
return o.toString().replace("\n", "\n ");
}
-
/**
* Create a new {@link UpdateSoda} instance. No arguments are required.
*/
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/NewSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/NewSoda.java
index 0e58e4ad4..8fb462951 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/NewSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/NewSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.uppercasefileextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -75,7 +73,8 @@ public class NewSoda
* Get name
* @return name The name of this {@link NewSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -103,7 +102,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link NewSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -131,7 +131,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link NewSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -159,7 +160,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link NewSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,6 +256,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/Soda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/Soda.java
index 920ee5c40..f20e47df0 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/Soda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/Soda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.uppercasefileextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -78,7 +76,8 @@ public class Soda
* Get id
* @return id The id of this {@link Soda} instance.
*/
- @Nonnull public Long getId() {
+ @Nonnull
+ public Long getId() {
return id;
}
@@ -106,7 +105,8 @@ public void setId( @Nullable final Long id) {
* Get name
* @return name The name of this {@link Soda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -134,7 +134,8 @@ public void setName( @Nonnull final String name) {
* Get brand
* @return brand The brand of this {@link Soda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -162,7 +163,8 @@ public void setBrand( @Nonnull final String brand) {
* Get flavor
* @return flavor The flavor of this {@link Soda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -190,7 +192,8 @@ public void setFlavor( @Nonnull final String flavor) {
* Get price
* @return price The price of this {@link Soda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -287,6 +290,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/UpdateSoda.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/UpdateSoda.java
index 6c881a5f7..8d1691b8f 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/UpdateSoda.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-uppercase-file-extension/output/com/sap/cloud/sdk/services/uppercasefileextension/model/UpdateSoda.java
@@ -16,23 +16,21 @@
package com.sap.cloud.sdk.services.uppercasefileextension.model;
+import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -75,7 +73,8 @@ public class UpdateSoda
* Get name
* @return name The name of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getName() {
+ @Nonnull
+ public String getName() {
return name;
}
@@ -103,7 +102,8 @@ public void setName( @Nullable final String name) {
* Get brand
* @return brand The brand of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getBrand() {
+ @Nonnull
+ public String getBrand() {
return brand;
}
@@ -131,7 +131,8 @@ public void setBrand( @Nullable final String brand) {
* Get flavor
* @return flavor The flavor of this {@link UpdateSoda} instance.
*/
- @Nonnull public String getFlavor() {
+ @Nonnull
+ public String getFlavor() {
return flavor;
}
@@ -159,7 +160,8 @@ public void setFlavor( @Nullable final String flavor) {
* Get price
* @return price The price of this {@link UpdateSoda} instance.
*/
- @Nonnull public Float getPrice() {
+ @Nonnull
+ public Float getPrice() {
return price;
}
@@ -254,6 +256,5 @@ private String toIndentedString(final java.lang.Object o) {
return o.toString().replace("\n", "\n ");
}
-
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/input/sodastore.yaml b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/input/sodastore.yaml
new file mode 100644
index 000000000..470276795
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/input/sodastore.yaml
@@ -0,0 +1,58 @@
+openapi: 3.0.0
+info:
+ title: Soda Store API
+ version: 1.0.0
+ description: API for managing sodas in a soda store
+paths:
+ /sodas:
+ get:
+ summary: Get a list of all sodas
+ operationId: getSodas
+ responses:
+ '200':
+ description: A list of sodas
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/OneOf'
+components:
+ schemas:
+ OneOfWithDiscriminatorAndMapping:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ mapping:
+ Cola: '#/components/schemas/Cola'
+ Fanta: '#/components/schemas/Fanta'
+ OneOfWithDiscriminator:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ OneOf:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AnyOf:
+ anyOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AllOf:
+ allOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ Cola:
+ type: object
+ properties:
+ sodaType:
+ type: string
+ Fanta:
+ type: object
+ properties:
+ sodaType:
+ type: string
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/AllOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/AllOf.java
new file mode 100644
index 000000000..a2c60509f
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/AllOf.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * AllOf
+ */
+// CHECKSTYLE:OFF
+public class AllOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link AllOf} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link AllOf}
+ * @return The same instance of this {@link AllOf} class
+ */
+ @Nonnull public AllOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link AllOf} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link AllOf} instance.
+ *
+ * @param sodaType The sodaType of this {@link AllOf}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link AllOf}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link AllOf} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("AllOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final AllOf allOf = (AllOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, allOf.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class AllOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/AnyOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/AnyOf.java
new file mode 100644
index 000000000..879569438
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/AnyOf.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * AnyOf
+ */
+// CHECKSTYLE:OFF
+public class AnyOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link AnyOf}
+ * @return The same instance of this {@link AnyOf} class
+ */
+ @Nonnull public AnyOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link AnyOf} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance.
+ *
+ * @param sodaType The sodaType of this {@link AnyOf}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link AnyOf}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link AnyOf} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("AnyOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final AnyOf anyOf = (AnyOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, anyOf.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class AnyOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/Cola.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/Cola.java
new file mode 100644
index 000000000..a2adbf686
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/Cola.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * Cola
+ */
+// CHECKSTYLE:OFF
+public class Cola
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link Cola} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link Cola}
+ * @return The same instance of this {@link Cola} class
+ */
+ @Nonnull public Cola sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link Cola} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Cola} instance.
+ *
+ * @param sodaType The sodaType of this {@link Cola}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Cola}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Cola} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Cola has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final Cola cola = (Cola) o;
+ return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, cola.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Cola {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/DefaultApi.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/DefaultApi.java
new file mode 100644
index 000000000..424ff2c43
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/DefaultApi.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+package test;
+
+import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
+import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse;
+import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
+import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
+
+import test.OneOf;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import com.google.common.annotations.Beta;
+
+import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
+
+/**
+ * Soda Store API in version 1.0.0.
+ *
+ * API for managing sodas in a soda store
+ */
+public class DefaultApi extends AbstractOpenApiService {
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API.
+ *
+ * @param httpDestination The destination that API should be used with
+ */
+ public DefaultApi( @Nonnull final Destination httpDestination )
+ {
+ super(httpDestination);
+ }
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API based on a given {@link ApiClient}.
+ *
+ * @param apiClient
+ * ApiClient to invoke the API on
+ */
+ @Beta
+ public DefaultApi( @Nonnull final ApiClient apiClient )
+ {
+ super(apiClient);
+ }
+
+ /**
+ * Get a list of all sodas
+ *
+ * 200 - A list of sodas
+ * @return List<OneOf>
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public List getSodas() throws OpenApiRequestException {
+ final Object localVarPostBody = null;
+
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { };
+
+ final ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/Fanta.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/Fanta.java
new file mode 100644
index 000000000..c6359bba1
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/Fanta.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * Fanta
+ */
+// CHECKSTYLE:OFF
+public class Fanta
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link Fanta}
+ * @return The same instance of this {@link Fanta} class
+ */
+ @Nonnull public Fanta sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link Fanta} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance.
+ *
+ * @param sodaType The sodaType of this {@link Fanta}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Fanta}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Fanta} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Fanta has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final Fanta fanta = (Fanta) o;
+ return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, fanta.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Fanta {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOf.java
new file mode 100644
index 000000000..7ad1e3e0a
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOf.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOf
+ */
+// CHECKSTYLE:OFF
+public class OneOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link OneOf} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOf}
+ * @return The same instance of this {@link OneOf} class
+ */
+ @Nonnull public OneOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link OneOf} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link OneOf} instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOf}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link OneOf}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link OneOf} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("OneOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link OneOf} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final OneOf oneOf = (OneOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, oneOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, oneOf.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class OneOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOfWithDiscriminator.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOfWithDiscriminator.java
new file mode 100644
index 000000000..883ee607c
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOfWithDiscriminator.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOfWithDiscriminator
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = Cola.class, name = "Cola"),
+ @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"),
+})
+// CHECKSTYLE:OFF
+public class OneOfWithDiscriminator
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminator} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminator}
+ * @return The same instance of this {@link OneOfWithDiscriminator} class
+ */
+ @Nonnull public OneOfWithDiscriminator sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link OneOfWithDiscriminator} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminator} instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminator}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link OneOfWithDiscriminator}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link OneOfWithDiscriminator} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("OneOfWithDiscriminator has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link OneOfWithDiscriminator} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final OneOfWithDiscriminator oneOfWithDiscriminator = (OneOfWithDiscriminator) o;
+ return Objects.equals(this.cloudSdkCustomFields, oneOfWithDiscriminator.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, oneOfWithDiscriminator.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class OneOfWithDiscriminator {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOfWithDiscriminatorAndMapping.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOfWithDiscriminatorAndMapping.java
new file mode 100644
index 000000000..f5f8c4ebc
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-disabled/output/test/OneOfWithDiscriminatorAndMapping.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOfWithDiscriminatorAndMapping
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = Cola.class, name = "Cola"),
+ @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"),
+})
+// CHECKSTYLE:OFF
+public class OneOfWithDiscriminatorAndMapping
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminatorAndMapping} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminatorAndMapping}
+ * @return The same instance of this {@link OneOfWithDiscriminatorAndMapping} class
+ */
+ @Nonnull public OneOfWithDiscriminatorAndMapping sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link OneOfWithDiscriminatorAndMapping} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link OneOfWithDiscriminatorAndMapping} instance.
+ *
+ * @param sodaType The sodaType of this {@link OneOfWithDiscriminatorAndMapping}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link OneOfWithDiscriminatorAndMapping}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link OneOfWithDiscriminatorAndMapping} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("OneOfWithDiscriminatorAndMapping has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link OneOfWithDiscriminatorAndMapping} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final OneOfWithDiscriminatorAndMapping oneOfWithDiscriminatorAndMapping = (OneOfWithDiscriminatorAndMapping) o;
+ return Objects.equals(this.cloudSdkCustomFields, oneOfWithDiscriminatorAndMapping.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, oneOfWithDiscriminatorAndMapping.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class OneOfWithDiscriminatorAndMapping {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/input/sodastore.yaml b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/input/sodastore.yaml
new file mode 100644
index 000000000..e7a169e45
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/input/sodastore.yaml
@@ -0,0 +1,58 @@
+openapi: 3.0.0
+info:
+ title: Soda Store API
+ version: 1.0.0
+ description: API for managing sodas in a soda store
+paths:
+ /sodas:
+ get:
+ summary: Get a list of all sodas
+ operationId: getSodas
+ responses:
+ '200':
+ description: A list of sodas
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/OneOf'
+components:
+ schemas:
+ OneOfWithDiscriminatorAndMapping:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ mapping:
+ cool_cola: '#/components/schemas/Cola'
+ fancy_fanta: '#/components/schemas/Fanta'
+ OneOfWithDiscriminator:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ discriminator:
+ propertyName: sodaType
+ OneOf:
+ oneOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AnyOf:
+ anyOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ AllOf:
+ allOf:
+ - $ref: '#/components/schemas/Cola'
+ - $ref: '#/components/schemas/Fanta'
+ Cola:
+ type: object
+ properties:
+ sodaType:
+ type: string
+ Fanta:
+ type: object
+ properties:
+ sodaType:
+ type: string
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/AllOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/AllOf.java
new file mode 100644
index 000000000..a2c60509f
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/AllOf.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * AllOf
+ */
+// CHECKSTYLE:OFF
+public class AllOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link AllOf} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link AllOf}
+ * @return The same instance of this {@link AllOf} class
+ */
+ @Nonnull public AllOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link AllOf} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link AllOf} instance.
+ *
+ * @param sodaType The sodaType of this {@link AllOf}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link AllOf}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link AllOf} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("AllOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final AllOf allOf = (AllOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, allOf.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class AllOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/AnyOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/AnyOf.java
new file mode 100644
index 000000000..879569438
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/AnyOf.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * AnyOf
+ */
+// CHECKSTYLE:OFF
+public class AnyOf
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link AnyOf}
+ * @return The same instance of this {@link AnyOf} class
+ */
+ @Nonnull public AnyOf sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link AnyOf} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link AnyOf} instance.
+ *
+ * @param sodaType The sodaType of this {@link AnyOf}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link AnyOf}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link AnyOf} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("AnyOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final AnyOf anyOf = (AnyOf) o;
+ return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, anyOf.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class AnyOf {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/Cola.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/Cola.java
new file mode 100644
index 000000000..3f3063d9d
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/Cola.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * Cola
+ */
+// CHECKSTYLE:OFF
+public class Cola implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link Cola} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link Cola}
+ * @return The same instance of this {@link Cola} class
+ */
+ @Nonnull public Cola sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link Cola} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Cola} instance.
+ *
+ * @param sodaType The sodaType of this {@link Cola}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Cola}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Cola} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Cola has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final Cola cola = (Cola) o;
+ return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, cola.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Cola {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/DefaultApi.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/DefaultApi.java
new file mode 100644
index 000000000..424ff2c43
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/DefaultApi.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+package test;
+
+import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
+import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse;
+import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
+import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
+
+import test.OneOf;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import com.google.common.annotations.Beta;
+
+import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
+
+/**
+ * Soda Store API in version 1.0.0.
+ *
+ * API for managing sodas in a soda store
+ */
+public class DefaultApi extends AbstractOpenApiService {
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API.
+ *
+ * @param httpDestination The destination that API should be used with
+ */
+ public DefaultApi( @Nonnull final Destination httpDestination )
+ {
+ super(httpDestination);
+ }
+
+ /**
+ * Instantiates this API class to invoke operations on the Soda Store API based on a given {@link ApiClient}.
+ *
+ * @param apiClient
+ * ApiClient to invoke the API on
+ */
+ @Beta
+ public DefaultApi( @Nonnull final ApiClient apiClient )
+ {
+ super(apiClient);
+ }
+
+ /**
+ * Get a list of all sodas
+ *
+ * 200 - A list of sodas
+ * @return List<OneOf>
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public List getSodas() throws OpenApiRequestException {
+ final Object localVarPostBody = null;
+
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { };
+
+ final ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/Fanta.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/Fanta.java
new file mode 100644
index 000000000..4ec3ade18
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/Fanta.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * Fanta
+ */
+// CHECKSTYLE:OFF
+public class Fanta implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping
+// CHECKSTYLE:ON
+{
+ @JsonProperty("sodaType")
+ private String sodaType;
+
+ @JsonAnySetter
+ @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance and return the same instance.
+ *
+ * @param sodaType The sodaType of this {@link Fanta}
+ * @return The same instance of this {@link Fanta} class
+ */
+ @Nonnull public Fanta sodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ return this;
+ }
+
+ /**
+ * Get sodaType
+ * @return sodaType The sodaType of this {@link Fanta} instance.
+ */
+ @Nonnull
+ public String getSodaType() {
+ return sodaType;
+ }
+
+ /**
+ * Set the sodaType of this {@link Fanta} instance.
+ *
+ * @param sodaType The sodaType of this {@link Fanta}
+ */
+ public void setSodaType( @Nullable final String sodaType) {
+ this.sodaType = sodaType;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link Fanta}.
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link Fanta} instance.
+ * @param name The name of the property
+ * @return The value of the property
+ * @throws NoSuchElementException If no property with the given name could be found.
+ */
+ @Nullable
+ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException {
+ if( !cloudSdkCustomFields.containsKey(name) ) {
+ throw new NoSuchElementException("Fanta has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained a mapping
+ * for the key, the old value is replaced by the specified value.
+ * @param customFieldName The name of the property
+ * @param customFieldValue The value of the property
+ */
+ @JsonIgnore
+ public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue )
+ {
+ cloudSdkCustomFields.put(customFieldName, customFieldValue);
+ }
+
+
+ @Override
+ public boolean equals(@Nullable final java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ final Fanta fanta = (Fanta) o;
+ return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields) &&
+ Objects.equals(this.sodaType, fanta.sodaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sodaType, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class Fanta {\n");
+ sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n");
+ cloudSdkCustomFields.forEach((k,v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(final java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOf.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOf.java
new file mode 100644
index 000000000..8100d34c3
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOf.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOf
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = Cola.class),
+ @JsonSubTypes.Type(value = Fanta.class),
+})
+
+public interface OneOf {
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOfWithDiscriminator.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOfWithDiscriminator.java
new file mode 100644
index 000000000..ada1c2cfe
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOfWithDiscriminator.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOfWithDiscriminator
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = Cola.class, name = "Cola"),
+ @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"),
+})
+
+public interface OneOfWithDiscriminator {
+ String getSodaType();
+}
+
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOfWithDiscriminatorAndMapping.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOfWithDiscriminatorAndMapping.java
new file mode 100644
index 000000000..e55a6a8d0
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/oneof-interfaces-enabled/output/test/OneOfWithDiscriminatorAndMapping.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+/*
+ * Soda Store API
+ * API for managing sodas in a soda store
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package test;
+
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import test.Cola;
+import test.Fanta;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * OneOfWithDiscriminatorAndMapping
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = Cola.class, name = "cool_cola"),
+ @JsonSubTypes.Type(value = Fanta.class, name = "fancy_fanta"),
+ @JsonSubTypes.Type(value = Cola.class, name = "Cola"),
+ @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"),
+})
+
+public interface OneOfWithDiscriminatorAndMapping {
+ String getSodaType();
+}
+
diff --git a/datamodel/openapi/openapi-api-sample/src/main/resources/sodastore.json b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/input/sodastore.json
similarity index 98%
rename from datamodel/openapi/openapi-api-sample/src/main/resources/sodastore.json
rename to datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/input/sodastore.json
index 2f2bd0412..e9ca71a1d 100644
--- a/datamodel/openapi/openapi-api-sample/src/main/resources/sodastore.json
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/input/sodastore.json
@@ -136,6 +136,7 @@
"paths": {
"/sodas": {
"get": {
+ "operationId": "foo.bar.get",
"summary": "Get all soda products",
"tags": [
"Sodas"
@@ -244,6 +245,7 @@
},
"/orders": {
"post": {
+ "operationId": "foo2.bar2.get",
"summary": "Create a new order",
"tags": [
"Orders"
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/api/DefaultApi.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/output/com/sap/cloud/sdk/services/builder/api/OrdersApi.java
similarity index 62%
rename from datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/api/DefaultApi.java
rename to datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/output/com/sap/cloud/sdk/services/builder/api/OrdersApi.java
index 1f3288fdf..f29ee9ebd 100644
--- a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/input-spec-with-anyof-oneof/output/com/sap/cloud/sdk/services/anyofoneof/api/DefaultApi.java
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/output/com/sap/cloud/sdk/services/builder/api/OrdersApi.java
@@ -2,14 +2,14 @@
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*/
-package com.sap.cloud.sdk.services.anyofoneof.api;
+package com.sap.cloud.sdk.services.builder.api;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse;
import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
-import com.sap.cloud.sdk.services.anyofoneof.model.RootObject;
+import com.sap.cloud.sdk.services.builder.model.Order;
import java.util.HashMap;
import java.util.List;
@@ -32,50 +32,52 @@
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
/**
- * Sample API in version 1.0.0.
+ * SodaStore API in version 1.0.0.
*
- * API for managing root and child objects
+ * API for managing soda products and orders in SodaStore.
*/
-public class DefaultApi extends AbstractOpenApiService {
+public class OrdersApi extends AbstractOpenApiService {
/**
- * Instantiates this API class to invoke operations on the Sample API.
+ * Instantiates this API class to invoke operations on the SodaStore API.
*
* @param httpDestination The destination that API should be used with
*/
- public DefaultApi( @Nonnull final Destination httpDestination )
+ public OrdersApi( @Nonnull final Destination httpDestination )
{
super(httpDestination);
}
/**
- * Instantiates this API class to invoke operations on the Sample API based on a given {@link ApiClient}.
+ * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link ApiClient}.
*
* @param apiClient
* ApiClient to invoke the API on
*/
@Beta
- public DefaultApi( @Nonnull final ApiClient apiClient )
+ public OrdersApi( @Nonnull final ApiClient apiClient )
{
super(apiClient);
}
-
- /**
+ /**
+ * Create a new order
*
- *
- * 201 - Something was created.
- *
400 - Request was invalid.
- *
401 - Authentication Error
- * @param rootObject (optional)
- The value for the parameter rootObject
- * @return RootObject
+ *
201 - The created order
+ * @param order
+ * The order details
+ * @return Order
* @throws OpenApiRequestException if an error occurs while attempting to invoke the API
*/
@Nonnull
- public RootObject someEndpointPost( @Nullable final RootObject rootObject) throws OpenApiRequestException {
- final Object localVarPostBody = rootObject;
+ public Order get( @Nonnull final Order order) throws OpenApiRequestException {
+ final Object localVarPostBody = order;
+
+ // verify the required parameter 'order' is set
+ if (order == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'order' when calling get");
+ }
- final String localVarPath = UriComponentsBuilder.fromPath("/some/endpoint").build().toUriString();
+ final String localVarPath = UriComponentsBuilder.fromPath("/orders").build().toUriString();
final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
final HttpHeaders localVarHeaderParams = new HttpHeaders();
@@ -90,23 +92,9 @@ public RootObject someEndpointPost( @Nullable final RootObject rootObject) throw
};
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
- final String[] localVarAuthNames = new String[] { };
+ final String[] localVarAuthNames = new String[] { "apiKeyAuth" };
- final ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ final ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(localVarPath, HttpMethod.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
-
- /**
- *
- *
- * 201 - Something was created.
- *
400 - Request was invalid.
- *
401 - Authentication Error
- * @return RootObject
- * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
- */
- @Nonnull
- public RootObject someEndpointPost() throws OpenApiRequestException {
- return someEndpointPost(null);
- }
}
diff --git a/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/output/com/sap/cloud/sdk/services/builder/api/SodasApi.java b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/output/com/sap/cloud/sdk/services/builder/api/SodasApi.java
new file mode 100644
index 000000000..04e72726f
--- /dev/null
+++ b/datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/remove-operation-id-prefix/output/com/sap/cloud/sdk/services/builder/api/SodasApi.java
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
+ */
+
+package com.sap.cloud.sdk.services.builder.api;
+
+import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
+import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse;
+import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
+import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
+
+import com.sap.cloud.sdk.services.builder.model.Soda;
+import com.sap.cloud.sdk.services.builder.model.SodaWithId;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import com.google.common.annotations.Beta;
+
+import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
+
+/**
+ * SodaStore API in version 1.0.0.
+ *
+ * API for managing soda products and orders in SodaStore.
+ */
+public class SodasApi extends AbstractOpenApiService {
+ /**
+ * Instantiates this API class to invoke operations on the SodaStore API.
+ *
+ * @param httpDestination The destination that API should be used with
+ */
+ public SodasApi( @Nonnull final Destination httpDestination )
+ {
+ super(httpDestination);
+ }
+
+ /**
+ * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link ApiClient}.
+ *
+ * @param apiClient
+ * ApiClient to invoke the API on
+ */
+ @Beta
+ public SodasApi( @Nonnull final ApiClient apiClient )
+ {
+ super(apiClient);
+ }
+
+ /**
+ *
Get all soda products
+ *
+ * 200 - A list of soda products
+ * @return List<SodaWithId>
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public List get() throws OpenApiRequestException {
+ final Object localVarPostBody = null;
+
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { "apiKeyAuth" };
+
+ final ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+ /**
+ * Get a specific soda product by ID
+ *
+ * 200 - The soda product
+ *
404 - Soda product not found
+ * @param id
+ * ID of the soda product to retrieve
+ * @return SodaWithId
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public SodaWithId sodasIdGet( @Nonnull final Long id) throws OpenApiRequestException {
+ final Object localVarPostBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'id' when calling sodasIdGet");
+ }
+
+ // create path and map variables
+ final Map localVarPathParams = new HashMap();
+ localVarPathParams.put("id", id);
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas/{id}").buildAndExpand(localVarPathParams).toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ final String[] localVarAuthNames = new String[] { "apiKeyAuth" };
+
+ final ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(localVarPath, HttpMethod.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+ /**
+ * Update a specific soda product by ID
+ *
+ * 200 - The updated soda product
+ *
404 - Soda product not found
+ *
204 - Nothing has changed
+ * @param sodaWithId
+ * The updated soda product
+ * @return Soda
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nullable
+ public Soda sodasPut( @Nonnull final SodaWithId sodaWithId) throws OpenApiRequestException {
+ final Object localVarPostBody = sodaWithId;
+
+ // verify the required parameter 'sodaWithId' is set
+ if (sodaWithId == null) {
+ throw new OpenApiRequestException("Missing the required parameter 'sodaWithId' when calling sodasPut");
+ }
+
+ final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString();
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap