headers) throws ApiException {
+ // verify the required parameter '_file' is set
+ if (_file == null) {
+ throw new ApiException(400, "Missing the required parameter '_file' when calling uploadPost");
+ }
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
@@ -400,6 +540,8 @@ private HttpRequest.Builder uploadPostRequestBuilder(@Nullable File _file, Map
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml
index 9fb2142503e4..c56e7b0a70c4 100644
--- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml
+++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/api/openapi.yaml
@@ -52,10 +52,34 @@ paths:
description: file
responses:
default:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/_upload_post_default_response"
description: ok
x-content-type: multipart/form-data
x-accepts:
- application/json
+ /download/{id}:
+ get:
+ parameters:
+ - explode: false
+ in: path
+ name: id
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "200":
+ content:
+ application/octet-stream:
+ schema:
+ format: binary
+ type: string
+ description: ok
+ x-accepts:
+ - application/octet-stream
components:
schemas:
Foo:
@@ -100,5 +124,17 @@ components:
file:
format: binary
type: string
+ metadata:
+ format: binary
+ type: string
+ required:
+ - file
type: object
+ _upload_post_default_response:
+ example:
+ id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
+ properties:
+ id:
+ format: uuid
+ type: string
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md
index 81e4c52b93f2..29e263ac5813 100644
--- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md
+++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md
@@ -4,11 +4,76 @@ All URIs are relative to *http://localhost*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
+| [**downloadIdGet**](DefaultApi.md#downloadIdGet) | **GET** /download/{id} | |
| [**fooDtParamGet**](DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | |
| [**uploadPost**](DefaultApi.md#uploadPost) | **POST** /upload | |
+## downloadIdGet
+
+> File downloadIdGet(id)
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.DefaultApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://localhost");
+
+ DefaultApi apiInstance = new DefaultApi(defaultClient);
+ String id = "id_example"; // String |
+ try {
+ File result = apiInstance.downloadIdGet(id);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DefaultApi#downloadIdGet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **id** | **String**| | |
+
+### Return type
+
+[**File**](File.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/octet-stream
+
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | ok | - |
+
+
## fooDtParamGet
> Foo fooDtParamGet(dtParam, dtQuery, dtCookie)
@@ -79,7 +144,7 @@ No authorization required
## uploadPost
-> uploadPost(_file)
+> UploadPostDefaultResponse uploadPost(_file, metadata)
@@ -100,8 +165,10 @@ public class Example {
DefaultApi apiInstance = new DefaultApi(defaultClient);
File _file = new File("/path/to/file"); // File |
+ File metadata = new File("/path/to/file"); // File |
try {
- apiInstance.uploadPost(_file);
+ UploadPostDefaultResponse result = apiInstance.uploadPost(_file, metadata);
+ System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#uploadPost");
System.err.println("Status code: " + e.getCode());
@@ -118,11 +185,12 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
-| **_file** | **File**| | [optional] |
+| **_file** | **File**| | |
+| **metadata** | **File**| | [optional] |
### Return type
-null (empty response body)
+[**UploadPostDefaultResponse**](UploadPostDefaultResponse.md)
### Authorization
@@ -131,7 +199,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
-- **Accept**: Not defined
+- **Accept**: application/json
### HTTP response details
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md
new file mode 100644
index 000000000000..e80266b51339
--- /dev/null
+++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md
@@ -0,0 +1,13 @@
+
+
+# UploadPostDefaultResponse
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **UUID** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/gradlew b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/gradlew
old mode 100755
new mode 100644
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
index 297a3a1625f6..6b4d05a1e91a 100644
--- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
+++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
@@ -6,6 +6,7 @@
import org.openapitools.client.model.Foo;
import org.jspecify.annotations.Nullable;
import java.time.OffsetDateTime;
+import org.openapitools.client.model.UploadPostDefaultResponse;
import java.util.HashMap;
import java.util.List;
@@ -47,6 +48,81 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return File
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ private ResponseSpec downloadIdGetRequestCreation(String id) throws RestClientResponseException {
+ Object postBody = null;
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ throw new RestClientResponseException("Missing the required parameter 'id' when calling downloadIdGet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // create path and map variables
+ final Map pathParams = new HashMap<>();
+
+ pathParams.put("id", id);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap<>();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap<>();
+ final MultiValueMap formParams = new LinkedMultiValueMap<>();
+
+ final String[] localVarAccepts = {
+ "application/octet-stream"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return apiClient.invokeAPI("/download/{id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return File
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public File downloadIdGet( String id) throws RestClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return downloadIdGetRequestCreation(id).body(localVarReturnType);
+ }
+
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return ResponseEntity<File>
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity downloadIdGetWithHttpInfo( String id) throws RestClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return downloadIdGetRequestCreation(id).toEntity(localVarReturnType);
+ }
+
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return ResponseSpec
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public ResponseSpec downloadIdGetWithResponseSpec(String id) throws RestClientResponseException {
+ return downloadIdGetRequestCreation(id);
+ }
+
/**
*
*
@@ -135,10 +211,16 @@ public ResponseSpec fooDtParamGetWithResponseSpec(java.time.@Nullable Instant dt
*
*
0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
+ * @return UploadPostDefaultResponse
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
- private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws RestClientResponseException {
+ private ResponseSpec uploadPostRequestCreation(File _file, @Nullable File metadata) throws RestClientResponseException {
Object postBody = null;
+ // verify the required parameter '_file' is set
+ if (_file == null) {
+ throw new RestClientResponseException("Missing the required parameter '_file' when calling uploadPost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
// create path and map variables
final Map pathParams = new HashMap<>();
@@ -149,8 +231,12 @@ private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws Rest
if (_file != null)
formParams.add("file", new FileSystemResource(_file));
+ if (metadata != null)
+ formParams.add("metadata", new FileSystemResource(metadata));
- final String[] localVarAccepts = { };
+ final String[] localVarAccepts = {
+ "application/json"
+ };
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
@@ -159,7 +245,7 @@ private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws Rest
String[] localVarAuthNames = new String[] { };
- ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
return apiClient.invokeAPI("/upload", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
@@ -168,11 +254,13 @@ private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws Rest
*
* 0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
+ * @return UploadPostDefaultResponse
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
- public void uploadPost(@Nullable File _file) throws RestClientResponseException {
- ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
- uploadPostRequestCreation(_file).body(localVarReturnType);
+ public UploadPostDefaultResponse uploadPost(File _file, @Nullable File metadata) throws RestClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return uploadPostRequestCreation(_file, metadata).body(localVarReturnType);
}
/**
@@ -180,11 +268,13 @@ public void uploadPost(@Nullable File _file) throws RestClientResponseException
*
* 0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
+ * @return ResponseEntity<UploadPostDefaultResponse>
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
- public ResponseEntity uploadPostWithHttpInfo(@Nullable File _file) throws RestClientResponseException {
- ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
- return uploadPostRequestCreation(_file).toEntity(localVarReturnType);
+ public ResponseEntity uploadPostWithHttpInfo(File _file, @Nullable File metadata) throws RestClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return uploadPostRequestCreation(_file, metadata).toEntity(localVarReturnType);
}
/**
@@ -192,10 +282,11 @@ public ResponseEntity uploadPostWithHttpInfo(@Nullable File _file) throws
*
* 0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
* @return ResponseSpec
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
- public ResponseSpec uploadPostWithResponseSpec(@Nullable File _file) throws RestClientResponseException {
- return uploadPostRequestCreation(_file);
+ public ResponseSpec uploadPostWithResponseSpec(File _file, @Nullable File metadata) throws RestClientResponseException {
+ return uploadPostRequestCreation(_file, metadata);
}
}
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
new file mode 100644
index 000000000000..88492b1fa700
--- /dev/null
+++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
@@ -0,0 +1,106 @@
+/*
+ * jspecify
+ * test fully qualified name and jspecify
+ *
+ * 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 org.openapitools.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+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.util.UUID;
+import org.jspecify.annotations.Nullable;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * UploadPostDefaultResponse
+ */
+@JsonPropertyOrder({
+ UploadPostDefaultResponse.JSON_PROPERTY_ID
+})
+@JsonTypeName("_upload_post_default_response")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0-SNAPSHOT")
+public class UploadPostDefaultResponse {
+ public static final String JSON_PROPERTY_ID = "id";
+
+ private @Nullable UUID id;
+
+ public UploadPostDefaultResponse() {
+ }
+
+ public UploadPostDefaultResponse id(@Nullable UUID id) {
+
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+
+ public @Nullable UUID getId() {
+ return id;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setId(@Nullable UUID id) {
+ this.id = id;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ UploadPostDefaultResponse uploadPostDefaultResponse = (UploadPostDefaultResponse) o;
+ return Objects.equals(this.id, uploadPostDefaultResponse.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class UploadPostDefaultResponse {\n");
+ sb.append(" id: ").append(toIndentedString(id)).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(Object o) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
index 2090a328d4a2..57aed2328926 100644
--- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
+++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
@@ -17,6 +17,7 @@
import org.openapitools.client.model.Foo;
import org.jspecify.annotations.Nullable;
import java.time.OffsetDateTime;
+import org.openapitools.client.model.UploadPostDefaultResponse;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -35,6 +36,19 @@ public class DefaultApiTest {
private final DefaultApi api = new DefaultApi();
+ /**
+ *
+ *
+ *
+ */
+ @Test
+ public void downloadIdGetTest() {
+ String id = null;
+ File response = api.downloadIdGet(id);
+
+ // TODO: test validations
+ }
+
/**
*
*
@@ -58,9 +72,10 @@ public void fooDtParamGetTest() {
@Test
public void uploadPostTest() {
File _file = null;
- api.uploadPost(_file);
+ File metadata = null;
+ UploadPostDefaultResponse response = api.uploadPost(_file, metadata);
// TODO: test validations
}
-}
\ No newline at end of file
+}
diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java
new file mode 100644
index 000000000000..6d0f7c414784
--- /dev/null
+++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java
@@ -0,0 +1,49 @@
+/*
+ * jspecify
+ * test fully qualified name and jspecify
+ *
+ * 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 org.openapitools.client.model;
+
+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.util.UUID;
+import org.jspecify.annotations.Nullable;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Model tests for UploadPostDefaultResponse
+ */
+class UploadPostDefaultResponseTest {
+ private final UploadPostDefaultResponse model = new UploadPostDefaultResponse();
+
+ /**
+ * Model tests for UploadPostDefaultResponse
+ */
+ @Test
+ void testUploadPostDefaultResponse() {
+ // TODO: test UploadPostDefaultResponse
+ }
+
+ /**
+ * Test the property 'id'
+ */
+ @Test
+ void idTest() {
+ // TODO: test id
+ }
+
+}
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES
index 56926e5b1c76..ecc0d11dd9e3 100644
--- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/.openapi-generator/FILES
@@ -7,6 +7,7 @@ build.gradle
build.sbt
docs/DefaultApi.md
docs/Foo.md
+docs/UploadPostDefaultResponse.md
git_push.sh
gradle.properties
gradle/wrapper/gradle-wrapper.jar
@@ -31,5 +32,6 @@ src/main/java/org/openapitools/client/auth/Authentication.java
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
src/main/java/org/openapitools/client/model/Foo.java
+src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
src/main/java/org/openapitools/client/model/package-info.java
src/main/java/org/openapitools/client/package-info.java
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md
index 96a11161cbc4..3670e69313c6 100644
--- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/README.md
@@ -93,14 +93,12 @@ public class DefaultApiExample {
defaultClient.setBasePath("http://localhost");
DefaultApi apiInstance = new DefaultApi(defaultClient);
- java.time.Instant dtParam = new java.time.Instant(); // java.time.Instant |
- java.time.Instant dtQuery = new java.time.Instant(); // java.time.Instant |
- java.time.Instant dtCookie = new java.time.Instant(); // java.time.Instant |
+ String id = "id_example"; // String |
try {
- Foo result = apiInstance.fooDtParamGet(dtParam, dtQuery, dtCookie);
+ File result = apiInstance.downloadIdGet(id);
System.out.println(result);
} catch (ApiException e) {
- System.err.println("Exception when calling DefaultApi#fooDtParamGet");
+ System.err.println("Exception when calling DefaultApi#downloadIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
@@ -117,6 +115,7 @@ All URIs are relative to *http://localhost*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**downloadIdGet**](docs/DefaultApi.md#downloadIdGet) | **GET** /download/{id} |
*DefaultApi* | [**fooDtParamGet**](docs/DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} |
*DefaultApi* | [**uploadPost**](docs/DefaultApi.md#uploadPost) | **POST** /upload |
@@ -124,6 +123,7 @@ Class | Method | HTTP request | Description
## Documentation for Models
- [Foo](docs/Foo.md)
+ - [UploadPostDefaultResponse](docs/UploadPostDefaultResponse.md)
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml
index 9fb2142503e4..c56e7b0a70c4 100644
--- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/api/openapi.yaml
@@ -52,10 +52,34 @@ paths:
description: file
responses:
default:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/_upload_post_default_response"
description: ok
x-content-type: multipart/form-data
x-accepts:
- application/json
+ /download/{id}:
+ get:
+ parameters:
+ - explode: false
+ in: path
+ name: id
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "200":
+ content:
+ application/octet-stream:
+ schema:
+ format: binary
+ type: string
+ description: ok
+ x-accepts:
+ - application/octet-stream
components:
schemas:
Foo:
@@ -100,5 +124,17 @@ components:
file:
format: binary
type: string
+ metadata:
+ format: binary
+ type: string
+ required:
+ - file
type: object
+ _upload_post_default_response:
+ example:
+ id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
+ properties:
+ id:
+ format: uuid
+ type: string
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/DefaultApi.md b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/DefaultApi.md
index 81e4c52b93f2..29e263ac5813 100644
--- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/DefaultApi.md
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/DefaultApi.md
@@ -4,11 +4,76 @@ All URIs are relative to *http://localhost*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
+| [**downloadIdGet**](DefaultApi.md#downloadIdGet) | **GET** /download/{id} | |
| [**fooDtParamGet**](DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | |
| [**uploadPost**](DefaultApi.md#uploadPost) | **POST** /upload | |
+## downloadIdGet
+
+> File downloadIdGet(id)
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.DefaultApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://localhost");
+
+ DefaultApi apiInstance = new DefaultApi(defaultClient);
+ String id = "id_example"; // String |
+ try {
+ File result = apiInstance.downloadIdGet(id);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DefaultApi#downloadIdGet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **id** | **String**| | |
+
+### Return type
+
+[**File**](File.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/octet-stream
+
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | ok | - |
+
+
## fooDtParamGet
> Foo fooDtParamGet(dtParam, dtQuery, dtCookie)
@@ -79,7 +144,7 @@ No authorization required
## uploadPost
-> uploadPost(_file)
+> UploadPostDefaultResponse uploadPost(_file, metadata)
@@ -100,8 +165,10 @@ public class Example {
DefaultApi apiInstance = new DefaultApi(defaultClient);
File _file = new File("/path/to/file"); // File |
+ File metadata = new File("/path/to/file"); // File |
try {
- apiInstance.uploadPost(_file);
+ UploadPostDefaultResponse result = apiInstance.uploadPost(_file, metadata);
+ System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#uploadPost");
System.err.println("Status code: " + e.getCode());
@@ -118,11 +185,12 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
-| **_file** | **File**| | [optional] |
+| **_file** | **File**| | |
+| **metadata** | **File**| | [optional] |
### Return type
-null (empty response body)
+[**UploadPostDefaultResponse**](UploadPostDefaultResponse.md)
### Authorization
@@ -131,7 +199,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
-- **Accept**: Not defined
+- **Accept**: application/json
### HTTP response details
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md
new file mode 100644
index 000000000000..e80266b51339
--- /dev/null
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md
@@ -0,0 +1,13 @@
+
+
+# UploadPostDefaultResponse
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **UUID** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
index 41b0dac5d763..242f7b2149aa 100644
--- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
@@ -7,6 +7,7 @@
import org.openapitools.client.model.Foo;
import org.jspecify.annotations.Nullable;
import java.time.OffsetDateTime;
+import org.openapitools.client.model.UploadPostDefaultResponse;
import java.util.Collections;
import java.util.HashMap;
@@ -40,6 +41,55 @@ public DefaultApi(ApiClient apiClient) {
super(apiClient);
}
+ /**
+ *
+ *
+ *
200 - ok
+ * @param id (required)
+ * @return File
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public File downloadIdGet(String id) throws RestClientException {
+ return downloadIdGetWithHttpInfo(id).getBody();
+ }
+
+ /**
+ *
+ *
+ *
200 - ok
+ * @param id (required)
+ * @return ResponseEntity<File>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity downloadIdGetWithHttpInfo(String id) throws RestClientException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling downloadIdGet");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("id", id);
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/octet-stream"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/download/{id}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
/**
*
*
@@ -98,24 +148,32 @@ public ResponseEntity fooDtParamGetWithHttpInfo(java.time.Instant dtParam,
*
*
* 0 - ok
- * @param _file (optional)
+ * @param _file (required)
+ * @param metadata (optional)
+ * @return UploadPostDefaultResponse
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
- public void uploadPost(File _file) throws RestClientException {
- uploadPostWithHttpInfo(_file);
+ public UploadPostDefaultResponse uploadPost(File _file, File metadata) throws RestClientException {
+ return uploadPostWithHttpInfo(_file, metadata).getBody();
}
/**
*
*
*
0 - ok
- * @param _file (optional)
- * @return ResponseEntity<Void>
+ * @param _file (required)
+ * @param metadata (optional)
+ * @return ResponseEntity<UploadPostDefaultResponse>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
- public ResponseEntity uploadPostWithHttpInfo(File _file) throws RestClientException {
+ public ResponseEntity uploadPostWithHttpInfo(File _file, File metadata) throws RestClientException {
Object localVarPostBody = null;
+ // verify the required parameter '_file' is set
+ if (_file == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_file' when calling uploadPost");
+ }
+
final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
final HttpHeaders localVarHeaderParams = new HttpHeaders();
@@ -124,8 +182,12 @@ public ResponseEntity uploadPostWithHttpInfo(File _file) throws RestClient
if (_file != null)
localVarFormParams.add("file", new FileSystemResource(_file));
+ if (metadata != null)
+ localVarFormParams.add("metadata", new FileSystemResource(metadata));
- final String[] localVarAccepts = { };
+ final String[] localVarAccepts = {
+ "application/json"
+ };
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
@@ -134,7 +196,7 @@ public ResponseEntity uploadPostWithHttpInfo(File _file) throws RestClient
String[] localVarAuthNames = new String[] { };
- ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/upload", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}
@@ -149,7 +211,9 @@ public ResponseEntity invokeAPI(String url, HttpMethod method, Object req
final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
- final String[] localVarAccepts = { };
+ final String[] localVarAccepts = {
+ "application/json"
+ };
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
new file mode 100644
index 000000000000..88492b1fa700
--- /dev/null
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
@@ -0,0 +1,106 @@
+/*
+ * jspecify
+ * test fully qualified name and jspecify
+ *
+ * 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 org.openapitools.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+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.util.UUID;
+import org.jspecify.annotations.Nullable;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * UploadPostDefaultResponse
+ */
+@JsonPropertyOrder({
+ UploadPostDefaultResponse.JSON_PROPERTY_ID
+})
+@JsonTypeName("_upload_post_default_response")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0-SNAPSHOT")
+public class UploadPostDefaultResponse {
+ public static final String JSON_PROPERTY_ID = "id";
+
+ private @Nullable UUID id;
+
+ public UploadPostDefaultResponse() {
+ }
+
+ public UploadPostDefaultResponse id(@Nullable UUID id) {
+
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+
+ public @Nullable UUID getId() {
+ return id;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setId(@Nullable UUID id) {
+ this.id = id;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ UploadPostDefaultResponse uploadPostDefaultResponse = (UploadPostDefaultResponse) o;
+ return Objects.equals(this.id, uploadPostDefaultResponse.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class UploadPostDefaultResponse {\n");
+ sb.append(" id: ").append(toIndentedString(id)).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(Object o) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
index 65ddba4827cf..16d378368afb 100644
--- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
@@ -17,6 +17,7 @@
import org.openapitools.client.model.Foo;
import org.jspecify.annotations.Nullable;
import java.time.OffsetDateTime;
+import org.openapitools.client.model.UploadPostDefaultResponse;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.web.client.RestClientException;
@@ -37,6 +38,23 @@ class DefaultApiTest {
private final DefaultApi api = new DefaultApi();
+ /**
+ *
+ *
+ *
+ *
+ * @throws RestClientException
+ * if the Api call fails
+ */
+ @Test
+ void downloadIdGetTest() {
+ String id = null;
+
+ File response = api.downloadIdGet(id);
+
+ // TODO: test validations
+ }
+
/**
*
*
@@ -67,8 +85,9 @@ void fooDtParamGetTest() {
@Test
void uploadPostTest() {
File _file = null;
+ File metadata = null;
- api.uploadPost(_file);
+ UploadPostDefaultResponse response = api.uploadPost(_file, metadata);
// TODO: test validations
}
diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java
new file mode 100644
index 000000000000..6d0f7c414784
--- /dev/null
+++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java
@@ -0,0 +1,49 @@
+/*
+ * jspecify
+ * test fully qualified name and jspecify
+ *
+ * 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 org.openapitools.client.model;
+
+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.util.UUID;
+import org.jspecify.annotations.Nullable;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Model tests for UploadPostDefaultResponse
+ */
+class UploadPostDefaultResponseTest {
+ private final UploadPostDefaultResponse model = new UploadPostDefaultResponse();
+
+ /**
+ * Model tests for UploadPostDefaultResponse
+ */
+ @Test
+ void testUploadPostDefaultResponse() {
+ // TODO: test UploadPostDefaultResponse
+ }
+
+ /**
+ * Test the property 'id'
+ */
+ @Test
+ void idTest() {
+ // TODO: test id
+ }
+
+}
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES
index d59cb3fdbb35..0fa31ce99624 100644
--- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/.openapi-generator/FILES
@@ -7,6 +7,7 @@ build.gradle
build.sbt
docs/DefaultApi.md
docs/Foo.md
+docs/UploadPostDefaultResponse.md
git_push.sh
gradle.properties
gradle/wrapper/gradle-wrapper.jar
@@ -31,5 +32,6 @@ src/main/java/org/openapitools/client/auth/Authentication.java
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
src/main/java/org/openapitools/client/model/Foo.java
+src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
src/main/java/org/openapitools/client/model/package-info.java
src/main/java/org/openapitools/client/package-info.java
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md
index c56d4cba598d..e2fe5cdc9d6c 100644
--- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/README.md
@@ -93,14 +93,12 @@ public class DefaultApiExample {
defaultClient.setBasePath("http://localhost");
DefaultApi apiInstance = new DefaultApi(defaultClient);
- java.time.Instant dtParam = new java.time.Instant(); // java.time.Instant |
- java.time.Instant dtQuery = new java.time.Instant(); // java.time.Instant |
- java.time.Instant dtCookie = new java.time.Instant(); // java.time.Instant |
+ String id = "id_example"; // String |
try {
- Foo result = apiInstance.fooDtParamGet(dtParam, dtQuery, dtCookie);
+ File result = apiInstance.downloadIdGet(id);
System.out.println(result);
} catch (ApiException e) {
- System.err.println("Exception when calling DefaultApi#fooDtParamGet");
+ System.err.println("Exception when calling DefaultApi#downloadIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
@@ -117,6 +115,7 @@ All URIs are relative to *http://localhost*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**downloadIdGet**](docs/DefaultApi.md#downloadIdGet) | **GET** /download/{id} |
*DefaultApi* | [**fooDtParamGet**](docs/DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} |
*DefaultApi* | [**uploadPost**](docs/DefaultApi.md#uploadPost) | **POST** /upload |
@@ -124,6 +123,7 @@ Class | Method | HTTP request | Description
## Documentation for Models
- [Foo](docs/Foo.md)
+ - [UploadPostDefaultResponse](docs/UploadPostDefaultResponse.md)
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml
index 9fb2142503e4..c56e7b0a70c4 100644
--- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/api/openapi.yaml
@@ -52,10 +52,34 @@ paths:
description: file
responses:
default:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/_upload_post_default_response"
description: ok
x-content-type: multipart/form-data
x-accepts:
- application/json
+ /download/{id}:
+ get:
+ parameters:
+ - explode: false
+ in: path
+ name: id
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "200":
+ content:
+ application/octet-stream:
+ schema:
+ format: binary
+ type: string
+ description: ok
+ x-accepts:
+ - application/octet-stream
components:
schemas:
Foo:
@@ -100,5 +124,17 @@ components:
file:
format: binary
type: string
+ metadata:
+ format: binary
+ type: string
+ required:
+ - file
type: object
+ _upload_post_default_response:
+ example:
+ id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
+ properties:
+ id:
+ format: uuid
+ type: string
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md
index 81e4c52b93f2..29e263ac5813 100644
--- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/DefaultApi.md
@@ -4,11 +4,76 @@ All URIs are relative to *http://localhost*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
+| [**downloadIdGet**](DefaultApi.md#downloadIdGet) | **GET** /download/{id} | |
| [**fooDtParamGet**](DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | |
| [**uploadPost**](DefaultApi.md#uploadPost) | **POST** /upload | |
+## downloadIdGet
+
+> File downloadIdGet(id)
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.DefaultApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://localhost");
+
+ DefaultApi apiInstance = new DefaultApi(defaultClient);
+ String id = "id_example"; // String |
+ try {
+ File result = apiInstance.downloadIdGet(id);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DefaultApi#downloadIdGet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **id** | **String**| | |
+
+### Return type
+
+[**File**](File.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/octet-stream
+
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | ok | - |
+
+
## fooDtParamGet
> Foo fooDtParamGet(dtParam, dtQuery, dtCookie)
@@ -79,7 +144,7 @@ No authorization required
## uploadPost
-> uploadPost(_file)
+> UploadPostDefaultResponse uploadPost(_file, metadata)
@@ -100,8 +165,10 @@ public class Example {
DefaultApi apiInstance = new DefaultApi(defaultClient);
File _file = new File("/path/to/file"); // File |
+ File metadata = new File("/path/to/file"); // File |
try {
- apiInstance.uploadPost(_file);
+ UploadPostDefaultResponse result = apiInstance.uploadPost(_file, metadata);
+ System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#uploadPost");
System.err.println("Status code: " + e.getCode());
@@ -118,11 +185,12 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
-| **_file** | **File**| | [optional] |
+| **_file** | **File**| | |
+| **metadata** | **File**| | [optional] |
### Return type
-null (empty response body)
+[**UploadPostDefaultResponse**](UploadPostDefaultResponse.md)
### Authorization
@@ -131,7 +199,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
-- **Accept**: Not defined
+- **Accept**: application/json
### HTTP response details
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md
new file mode 100644
index 000000000000..e80266b51339
--- /dev/null
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/docs/UploadPostDefaultResponse.md
@@ -0,0 +1,13 @@
+
+
+# UploadPostDefaultResponse
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **UUID** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
index ed9c59879506..89386a51d394 100644
--- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/api/DefaultApi.java
@@ -6,6 +6,7 @@
import org.openapitools.client.model.Foo;
import org.jspecify.annotations.Nullable;
import java.time.OffsetDateTime;
+import org.openapitools.client.model.UploadPostDefaultResponse;
import java.util.HashMap;
import java.util.List;
@@ -49,6 +50,81 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return File
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ private ResponseSpec downloadIdGetRequestCreation(String id) throws WebClientResponseException {
+ Object postBody = null;
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ throw new WebClientResponseException("Missing the required parameter 'id' when calling downloadIdGet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // create path and map variables
+ final Map pathParams = new HashMap();
+
+ pathParams.put("id", id);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/octet-stream"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/download/{id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return File
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public Mono downloadIdGet(String id) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return downloadIdGetRequestCreation(id).bodyToMono(localVarReturnType);
+ }
+
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return ResponseEntity<File>
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public Mono> downloadIdGetWithHttpInfo(String id) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return downloadIdGetRequestCreation(id).toEntity(localVarReturnType);
+ }
+
+ /**
+ *
+ *
+ * 200 - ok
+ * @param id The id parameter
+ * @return ResponseSpec
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public ResponseSpec downloadIdGetWithResponseSpec(String id) throws WebClientResponseException {
+ return downloadIdGetRequestCreation(id);
+ }
+
/**
*
*
@@ -137,10 +213,16 @@ public ResponseSpec fooDtParamGetWithResponseSpec(java.time.@Nullable Instant dt
*
*
0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
+ * @return UploadPostDefaultResponse
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
- private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws WebClientResponseException {
+ private ResponseSpec uploadPostRequestCreation(File _file, @Nullable File metadata) throws WebClientResponseException {
Object postBody = null;
+ // verify the required parameter '_file' is set
+ if (_file == null) {
+ throw new WebClientResponseException("Missing the required parameter '_file' when calling uploadPost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
// create path and map variables
final Map pathParams = new HashMap();
@@ -151,8 +233,12 @@ private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws WebC
if (_file != null)
formParams.add("file", new FileSystemResource(_file));
+ if (metadata != null)
+ formParams.add("metadata", new FileSystemResource(metadata));
- final String[] localVarAccepts = { };
+ final String[] localVarAccepts = {
+ "application/json"
+ };
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
@@ -161,7 +247,7 @@ private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws WebC
String[] localVarAuthNames = new String[] { };
- ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/upload", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
@@ -170,11 +256,13 @@ private ResponseSpec uploadPostRequestCreation(@Nullable File _file) throws WebC
*
* 0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
+ * @return UploadPostDefaultResponse
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
- public Mono uploadPost(@Nullable File _file) throws WebClientResponseException {
- ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
- return uploadPostRequestCreation(_file).bodyToMono(localVarReturnType);
+ public Mono uploadPost(File _file, @Nullable File metadata) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return uploadPostRequestCreation(_file, metadata).bodyToMono(localVarReturnType);
}
/**
@@ -182,11 +270,13 @@ public Mono uploadPost(@Nullable File _file) throws WebClientResponseExcep
*
* 0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
+ * @return ResponseEntity<UploadPostDefaultResponse>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
- public Mono> uploadPostWithHttpInfo(@Nullable File _file) throws WebClientResponseException {
- ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
- return uploadPostRequestCreation(_file).toEntity(localVarReturnType);
+ public Mono> uploadPostWithHttpInfo(File _file, @Nullable File metadata) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return uploadPostRequestCreation(_file, metadata).toEntity(localVarReturnType);
}
/**
@@ -194,10 +284,11 @@ public Mono> uploadPostWithHttpInfo(@Nullable File _file) t
*
* 0 - ok
* @param _file The _file parameter
+ * @param metadata The metadata parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
- public ResponseSpec uploadPostWithResponseSpec(@Nullable File _file) throws WebClientResponseException {
- return uploadPostRequestCreation(_file);
+ public ResponseSpec uploadPostWithResponseSpec(File _file, @Nullable File metadata) throws WebClientResponseException {
+ return uploadPostRequestCreation(_file, metadata);
}
}
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
new file mode 100644
index 000000000000..c8e93b7b04d8
--- /dev/null
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/UploadPostDefaultResponse.java
@@ -0,0 +1,105 @@
+/*
+ * jspecify
+ * test fully qualified name and jspecify
+ *
+ * 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 org.openapitools.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+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.util.UUID;
+import org.jspecify.annotations.Nullable;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+/**
+ * UploadPostDefaultResponse
+ */
+@JsonPropertyOrder({
+ UploadPostDefaultResponse.JSON_PROPERTY_ID
+})
+@JsonTypeName("_upload_post_default_response")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0-SNAPSHOT")
+public class UploadPostDefaultResponse {
+ public static final String JSON_PROPERTY_ID = "id";
+
+ private @Nullable UUID id;
+
+ public UploadPostDefaultResponse() {
+ }
+
+ public UploadPostDefaultResponse id(@Nullable UUID id) {
+
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+
+ public @Nullable UUID getId() {
+ return id;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setId(@Nullable UUID id) {
+ this.id = id;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ UploadPostDefaultResponse uploadPostDefaultResponse = (UploadPostDefaultResponse) o;
+ return Objects.equals(this.id, uploadPostDefaultResponse.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class UploadPostDefaultResponse {\n");
+ sb.append(" id: ").append(toIndentedString(id)).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(Object o) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
index 706e3b1b6de3..5f350074dd1d 100644
--- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/api/DefaultApiTest.java
@@ -17,6 +17,7 @@
import org.openapitools.client.model.Foo;
import org.jspecify.annotations.Nullable;
import java.time.OffsetDateTime;
+import org.openapitools.client.model.UploadPostDefaultResponse;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -36,6 +37,20 @@ public class DefaultApiTest {
private final DefaultApi api = new DefaultApi();
+ /**
+ *
+ *
+ *
+ */
+ @Test
+ public void downloadIdGetTest() {
+ // uncomment below to test the function
+ //String id = null;
+ //File response = api.downloadIdGet(id).block();
+
+ // TODO: test validations
+ }
+
/**
*
*
@@ -44,9 +59,9 @@ public class DefaultApiTest {
@Test
public void fooDtParamGetTest() {
// uncomment below to test the function
- //OffsetDateTime dtParam = null;
- //OffsetDateTime dtQuery = null;
- //OffsetDateTime dtCookie = null;
+ //java.time.Instant dtParam = null;
+ //java.time.Instant dtQuery = null;
+ //java.time.Instant dtCookie = null;
//Foo response = api.fooDtParamGet(dtParam, dtQuery, dtCookie).block();
// TODO: test validations
@@ -61,7 +76,8 @@ public void fooDtParamGetTest() {
public void uploadPostTest() {
// uncomment below to test the function
//File _file = null;
- //api.uploadPost(_file).block();
+ //File metadata = null;
+ //UploadPostDefaultResponse response = api.uploadPost(_file, metadata).block();
// TODO: test validations
}
diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java
new file mode 100644
index 000000000000..6d0f7c414784
--- /dev/null
+++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/test/java/org/openapitools/client/model/UploadPostDefaultResponseTest.java
@@ -0,0 +1,49 @@
+/*
+ * jspecify
+ * test fully qualified name and jspecify
+ *
+ * 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 org.openapitools.client.model;
+
+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.util.UUID;
+import org.jspecify.annotations.Nullable;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Model tests for UploadPostDefaultResponse
+ */
+class UploadPostDefaultResponseTest {
+ private final UploadPostDefaultResponse model = new UploadPostDefaultResponse();
+
+ /**
+ * Model tests for UploadPostDefaultResponse
+ */
+ @Test
+ void testUploadPostDefaultResponse() {
+ // TODO: test UploadPostDefaultResponse
+ }
+
+ /**
+ * Test the property 'id'
+ */
+ @Test
+ void idTest() {
+ // TODO: test id
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES
index 732881edb8e3..2c7a524f5c12 100644
--- a/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/springboot-4-jspecify/.openapi-generator/FILES
@@ -1,8 +1,11 @@
+.openapi-generator-ignore
README.md
pom.xml
src/main/java/org/openapitools/api/ApiUtil.java
+src/main/java/org/openapitools/api/DownloadApi.java
src/main/java/org/openapitools/api/FooApi.java
src/main/java/org/openapitools/api/UploadApi.java
src/main/java/org/openapitools/api/package-info.java
src/main/java/org/openapitools/model/Foo.java
+src/main/java/org/openapitools/model/UploadPostDefaultResponse.java
src/main/java/org/openapitools/model/package-info.java
diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/DownloadApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/DownloadApi.java
new file mode 100644
index 000000000000..20680b7af10f
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/DownloadApi.java
@@ -0,0 +1,71 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.api;
+
+import io.swagger.v3.oas.annotations.ExternalDocumentation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.ExampleObject;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import jakarta.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT")
+@Validated
+@Tag(name = "download", description = "the download API")
+public interface DownloadApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_DOWNLOAD_ID_GET = "/download/{id}";
+ /**
+ * GET /download/{id}
+ *
+ * @param id (required)
+ * @return ok (status code 200)
+ */
+ @Operation(
+ operationId = "downloadIdGet",
+ responses = {
+ @ApiResponse(responseCode = "200", description = "ok", content = {
+ @Content(mediaType = "application/octet-stream", schema = @Schema(implementation = org.springframework.core.io.Resource.class))
+ })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = DownloadApi.PATH_DOWNLOAD_ID_GET,
+ produces = { "application/octet-stream" }
+ )
+ default ResponseEntity downloadIdGet(
+ @Parameter(name = "id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("id") String id
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/UploadApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/UploadApi.java
index 616d6a474924..96b406084cf2 100644
--- a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/UploadApi.java
+++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/UploadApi.java
@@ -6,6 +6,7 @@
package org.openapitools.api;
import org.jspecify.annotations.Nullable;
+import org.openapitools.model.UploadPostDefaultResponse;
import io.swagger.v3.oas.annotations.ExternalDocumentation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -46,23 +47,37 @@ default Optional getRequest() {
/**
* POST /upload
*
- * @param file (optional)
+ * @param file (required)
+ * @param metadata (optional)
* @return ok (status code 200)
*/
@Operation(
operationId = "uploadPost",
responses = {
- @ApiResponse(responseCode = "default", description = "ok")
+ @ApiResponse(responseCode = "default", description = "ok", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = UploadPostDefaultResponse.class))
+ })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = UploadApi.PATH_UPLOAD_POST,
+ produces = { "application/json" },
consumes = { "multipart/form-data" }
)
- default ResponseEntity uploadPost(
- @Parameter(name = "file", description = "") @RequestPart(value = "file", required = false) MultipartFile file
+ default ResponseEntity uploadPost(
+ @Parameter(name = "file", description = "", required = true) @RequestPart(value = "file", required = true) MultipartFile file,
+ @Parameter(name = "metadata", description = "") @RequestPart(value = "metadata", required = false) MultipartFile metadata
) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/UploadPostDefaultResponse.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/UploadPostDefaultResponse.java
new file mode 100644
index 000000000000..14774d8b0057
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/UploadPostDefaultResponse.java
@@ -0,0 +1,163 @@
+package org.openapitools.model;
+
+import java.net.URI;
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import java.util.UUID;
+import org.jspecify.annotations.Nullable;
+import java.time.OffsetDateTime;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import tools.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import tools.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import tools.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import jakarta.xml.bind.annotation.*;
+
+import java.util.*;
+import jakarta.annotation.Generated;
+
+/**
+ * UploadPostDefaultResponse
+ */
+
+@JsonTypeName("_upload_post_default_response")
+@JacksonXmlRootElement(localName = "UploadPostDefaultResponse")
+@XmlRootElement(name = "UploadPostDefaultResponse")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT")
+public class UploadPostDefaultResponse {
+
+ private @Nullable UUID id;
+
+ public UploadPostDefaultResponse() {
+ super();
+ }
+
+ /**
+ * Constructor with all args parameters
+ */
+ public UploadPostDefaultResponse(UUID id) {
+ this.id = id;
+ }
+
+ public UploadPostDefaultResponse id(UUID id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+ @Valid
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("id")
+ @JacksonXmlProperty(localName = "id")
+ @XmlElement(name = "id")
+ public @Nullable UUID getId() {
+ return id;
+ }
+
+ @JsonProperty("id")
+ @JacksonXmlProperty(localName = "id")
+ public void setId(@Nullable UUID id) {
+ this.id = id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ UploadPostDefaultResponse uploadPostDefaultResponse = (UploadPostDefaultResponse) o;
+ return Objects.equals(this.id, uploadPostDefaultResponse.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class UploadPostDefaultResponse {\n");
+ sb.append(" id: ").append(toIndentedString(id)).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(Object o) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+ public static class Builder {
+
+ private UploadPostDefaultResponse instance;
+
+ public Builder() {
+ this(new UploadPostDefaultResponse());
+ }
+
+ protected Builder(UploadPostDefaultResponse instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(UploadPostDefaultResponse value) {
+ this.instance.setId(value.id);
+ return this;
+ }
+
+ public UploadPostDefaultResponse.Builder id(UUID id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ /**
+ * returns a built UploadPostDefaultResponse instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public UploadPostDefaultResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static UploadPostDefaultResponse.Builder builder() {
+ return new UploadPostDefaultResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public UploadPostDefaultResponse.Builder toBuilder() {
+ UploadPostDefaultResponse.Builder builder = new UploadPostDefaultResponse.Builder();
+ return builder.copyOf(this);
+ }
+
+}
+