Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
888bc4d
Move resttemplate moustache into dedicated folder
rpanackal Dec 10, 2025
3473fff
Revert "Move resttemplate moustache into dedicated folder"
rpanackal Dec 10, 2025
7991ce9
Add apache-httpclient/api.moustache
rpanackal Dec 10, 2025
6638e7a
openapi apache sample
rpanackal Dec 11, 2025
c08ceb6
remove ``@Generated`
rpanackal Dec 11, 2025
a697b6e
Add apache-client common generated classes and dependency
rpanackal Dec 11, 2025
28e8135
dependency and formatting
rpanackal Dec 11, 2025
c3e438f
Add all required file (pruned later)
rpanackal Dec 11, 2025
c934b1f
Fix dependencies
rpanackal Dec 11, 2025
ea0eeb6
Simply api-apache-sample
rpanackal Dec 11, 2025
b81f4c2
Merge branch 'main' into feat/openapi/optional-spring-base
rpanackal Dec 29, 2025
50a57bb
Fix version issue
rpanackal Dec 29, 2025
6a33cf6
Pom config and exclusions
rpanackal Dec 29, 2025
cde369f
Set format skip false for sample module
rpanackal Dec 30, 2025
50a0e0f
Merge branch 'main' into feat/openapi/optional-spring-base
rpanackal Jan 8, 2026
1c0bef8
refactor: [OpenAPI] Part 1: Refactor Apache related files and templat…
rpanackal Jan 12, 2026
84b4e9e
Merge branch 'main' into feat/openapi/optional-spring-base
rpanackal Jan 12, 2026
f02fd1d
Fix CI/CD
rpanackal Jan 12, 2026
cefb244
checkstyle
rpanackal Jan 12, 2026
1632d2c
pmd
rpanackal Jan 12, 2026
1e00604
pmd
rpanackal Jan 12, 2026
4835a34
Update datamodel/openapi/openapi-generator/src/main/resources/openapi…
rpanackal Jan 13, 2026
de76c72
Review: Apache Method enum and ctor formatting
rpanackal Jan 13, 2026
067ddc8
Merge remote-tracking branch 'origin/feat/openapi/optional-spring-bas…
rpanackal Jan 13, 2026
de01665
Update datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk…
rpanackal Jan 13, 2026
b7d623e
Fix compliance issue and formatting
rpanackal Jan 13, 2026
1226e6f
Make return statement always present
rpanackal Jan 14, 2026
d8a945e
minor changes in mustache files
rpanackal Jan 15, 2026
859a8f1
feat: [OpenAPI] Part 2: Testing Apache Client Support and some fixes.…
rpanackal Jan 15, 2026
f05242f
Fix missed line on merge
rpanackal Jan 15, 2026
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
107 changes: 107 additions & 0 deletions datamodel/openapi/openapi-api-apache-sample/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?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.26.0-SNAPSHOT</version>
</parent>

<artifactId>openapi-api-apache-sample</artifactId>

<properties>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<configuration>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<enableOneOfAnyOfGeneration>true</enableOneOfAnyOfGeneration>
<deleteOutputDirectory>true</deleteOutputDirectory>
</configuration>
<executions>
<execution>
<id>sample-generation</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/sodastore.yaml</inputSpec>
<apiPackage>com.sap.cloud.sdk.datamodel.openapi.apache.sample.api</apiPackage>
<modelPackage>com.sap.cloud.sdk.datamodel.openapi.apache.sample.model</modelPackage>
<additionalProperties>
<supportingFiles>true</supportingFiles>
<invokerPackage>com.sap.cloud.sdk.services.openapi.apache</invokerPackage>
<library>apache-httpclient</library>
<supportUrlQuery>false</supportUrlQuery>
<useOneOfInterfaces>true</useOneOfInterfaces>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
<removeOperationIdPrefix>true</removeOperationIdPrefix>
<removeOperationIdPrefixDelimiter>\.</removeOperationIdPrefixDelimiter>
<removeOperationIdPrefixCount>3</removeOperationIdPrefixCount>
<!-- Custom Cloud SDK settings -->
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<useOneOfCreators>true</useOneOfCreators>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*
* SodaStore API
* API for managing soda products and orders in SodaStore.
*
*
*
* 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.apache.sample.api;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;

import com.fasterxml.jackson.core.type.TypeReference;
import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.Order;
import com.sap.cloud.sdk.services.openapi.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.ApiException;
import com.sap.cloud.sdk.services.openapi.apache.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.Configuration;
import com.sap.cloud.sdk.services.openapi.apache.Pair;

public class OrdersApi extends BaseApi
{

public OrdersApi()
{
super(Configuration.getDefaultApiClient());
}

public OrdersApi( ApiClient apiClient )
{
super(apiClient);
}

/**
* Create a new order
*
* @param order
* The order details (required)
* @return Order
* @throws ApiException
* if fails to make API call
*/
public Order ordersPost( @javax.annotation.Nonnull Order order )
Copy link
Contributor

Choose a reason for hiding this comment

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

(Question/Optional)

It may be worth our time to check for alternatives to javax.annotation.Nonnull null-indicator annotations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Surely Jspecify is an option. But I guess that would merit a larger refactoring throughout the sdk

throws ApiException
{
return this.ordersPost(order, Collections.emptyMap());
}

/**
* Create a new order
*
* @param order
* The order details (required)
* @param additionalHeaders
* additionalHeaders for this call
* @return Order
* @throws ApiException
* if fails to make API call
*/
public Order ordersPost( @javax.annotation.Nonnull Order order, Map<String, String> additionalHeaders )
throws ApiException
{
Object localVarPostBody = order;

// verify the required parameter 'order' is set
if( order == null ) {
throw new ApiException(400, "Missing the required parameter 'order' when calling ordersPost");
}

// create path and map variables
String localVarPath = "/orders";

StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();

localVarHeaderParams.putAll(additionalHeaders);

final String[] localVarAccepts = { "application/json" };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

final String[] localVarContentTypes = { "application/json" };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

String[] localVarAuthNames = new String[] { "apiKeyAuth" };

TypeReference<Order> localVarReturnType = new TypeReference<Order>()
{
};
return apiClient
.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(),
localVarPostBody,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
}

@Override
public <T> T invokeAPI(
String url,
String method,
Object request,
TypeReference<T> returnType,
Map<String, String> additionalHeaders )
throws ApiException
{
String localVarPath = url.replace(apiClient.getBaseURL(), "");
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();

localVarHeaderParams.putAll(additionalHeaders);

final String[] localVarAccepts = { "application/json" };
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

final String[] localVarContentTypes = { "application/json" };
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

String[] localVarAuthNames = new String[] { "apiKeyAuth" };

return apiClient
.invokeAPI(
localVarPath,
method,
localVarQueryParams,
localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(),
request,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
returnType);
}
}
Loading
Loading