Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datamodel/openapi/openapi-api-apache-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-core</artifactId>
<artifactId>openapi-core-apache</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.datamodel.openapi.apache.petstore.model.Pet;
import com.sap.cloud.sdk.datamodel.openapi.apache.petstore.model.PetInput;
import com.sap.cloud.sdk.services.openapi.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.OpenApiResponse;
import com.sap.cloud.sdk.services.openapi.apache.Pair;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse;

/**
* Swagger Petstore in version 1.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.datamodel.openapi.apache.sodastore.model.Order;
import com.sap.cloud.sdk.services.openapi.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.Pair;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException;

/**
* SodaStore API in version 1.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.datamodel.openapi.apache.sodastore.model.Soda;
import com.sap.cloud.sdk.datamodel.openapi.apache.sodastore.model.SodaWithId;
import com.sap.cloud.sdk.services.openapi.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.Pair;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException;

/**
* SodaStore API in version 1.0.0.
Expand Down
98 changes: 98 additions & 0 deletions datamodel/openapi/openapi-core-apache/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-parent</artifactId>
<version>5.27.0-SNAPSHOT</version>
</parent>
<artifactId>openapi-core-apache</artifactId>
<name>Data Model - OpenAPI Services - Apache Core</name>
<description>Generic OpenAPI API Core Wrapper for Apache client</description>
<url>https://sap.github.io/cloud-sdk/docs/java/getting-started</url>
<organization>
<name>SAP SE</name>
<url>https://www.sap.com</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>SAP</name>
<email>cloudsdk@sap.com</email>
<organization>SAP SE</organization>
<organizationUrl>https://www.sap.com</organizationUrl>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-connectivity</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>connectivity-apache-httpclient5</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- scope "provided" -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- scope "test" -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* Do not edit the class manually.
*/

package com.sap.cloud.sdk.services.openapi.apache;
package com.sap.cloud.sdk.services.openapi.apache.apiclient;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Question/Major)

This is a breaking change for users that may have depended on the new classes, right?
Is this an accepted risk?

Copy link
Member Author

@rpanackal rpanackal Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption is that risk is very low since the newly released classes were never advertised, therefore this shouldn't be a problem.

I can also remove the apiclient package and extract the classes within to the outer package com.sap.cloud.sdk.services.openapi. I original intention was to we keep the same module structure as in openapi-core.
This will not entirely solve the issue because classes in core package eg: OpenApiResponse, OpenApiRequestException will still be affected.

Do you have a different take?


import static com.sap.cloud.sdk.services.openapi.apache.DefaultApiResponseHandler.isJsonMime;
import static com.sap.cloud.sdk.services.openapi.apache.apiclient.DefaultApiResponseHandler.isJsonMime;
import static lombok.AccessLevel.PRIVATE;

import java.io.File;
Expand Down Expand Up @@ -60,8 +60,8 @@
import com.google.common.annotations.Beta;
import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor;
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponseListener;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

package com.sap.cloud.sdk.services.openapi.apache;
package com.sap.cloud.sdk.services.openapi.apache.apiclient;

import javax.annotation.Nonnull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

package com.sap.cloud.sdk.services.openapi.apache;
package com.sap.cloud.sdk.services.openapi.apache.apiclient;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -43,7 +43,9 @@

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponseListener;

import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

package com.sap.cloud.sdk.services.openapi.apache;
package com.sap.cloud.sdk.services.openapi.apache.apiclient;

import javax.annotation.Nonnull;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.sap.cloud.sdk.services.openapi.apache.apiclient;

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.FieldPosition;
import java.text.ParsePosition;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.fasterxml.jackson.databind.util.StdDateFormat;

/**
* Date format according to the <a href="https://www.rfc-editor.org/rfc/rfc3339">RFC3339</a>.
*/
class RFC3339DateFormat extends DateFormat
{
private static final long serialVersionUID = 1L;
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");

private final StdDateFormat fmt = new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true);

/**
* Default constructor
*/
RFC3339DateFormat()
{
calendar = new GregorianCalendar();
numberFormat = new DecimalFormat();
}

@Override
@Nonnull
public Date parse( @Nonnull final String source )
{
return parse(source, new ParsePosition(0));
}

@Override
@Nonnull
public Date parse( @Nonnull final String source, @Nonnull final ParsePosition pos )
{
return fmt.parse(source, pos);
}

@Override
@Nonnull
public StringBuffer format(
@Nonnull final Date date,
@Nonnull final StringBuffer toAppendTo,
@Nullable final FieldPosition fieldPosition )
{
return fmt.format(date, toAppendTo, fieldPosition);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.sap.cloud.sdk.services.openapi.apache.core;

import java.util.List;
import java.util.Map;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
* Thrown if an error occurs during the invocation of a OpenAPI service.
*/
@Accessors( fluent = true )
@Getter
@Setter
public class OpenApiRequestException extends RuntimeException
{
private static final long serialVersionUID = -8248392392632616674L;

@Nullable
private Integer statusCode;
@Nullable
private transient Map<String, List<String>> responseHeaders;
@Nullable
private transient String responseBody;

/**
* Thrown if an error occurs during the invocation of a OpenAPI service.
*
* @param message
* The message of this exception
*/
public OpenApiRequestException( @Nonnull final String message )
{
super(message);
}

/**
* Thrown if an error occurs during the invocation of a OpenAPI service.
*
* @param message
* The message of this exception
* @param cause
* The cause of this exception
*/
public OpenApiRequestException( @Nonnull final String message, @Nonnull final Throwable cause )
{
super(message, cause);
}

/**
* Thrown if an error occurs during the invocation of a OpenAPI service.
*
* @param cause
* The cause of this exception
*/
public OpenApiRequestException( @Nonnull final Throwable cause )
{
super(cause);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cloud.sdk.services.openapi.apache;
package com.sap.cloud.sdk.services.openapi.apache.core;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cloud.sdk.services.openapi.apache;
package com.sap.cloud.sdk.services.openapi.apache.core;

import javax.annotation.Nonnull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cloud.sdk.services.openapi.apiclient;
package com.sap.cloud.sdk.services.openapi.apache.apiclient;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
Expand All @@ -20,11 +20,8 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
import com.sap.cloud.sdk.services.openapi.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.OpenApiResponse;
import com.sap.cloud.sdk.services.openapi.apache.Pair;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cloud.sdk.services.openapi.apiclient;
package com.sap.cloud.sdk.services.openapi.apache.apiclient;

import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
Expand Down Expand Up @@ -29,9 +29,6 @@
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.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.Pair;

import jdk.jfr.Description;

Expand Down
Loading