Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isPathParam}}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ paths:
default:
description: ok

/file/{id}:
get:
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
'200':
description: ok

components:
schemas:
Foo:
Expand Down
11 changes: 5 additions & 6 deletions samples/client/petstore/java/native-jackson3-jspecify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,11 @@ public class DefaultApiExample {
// Configure clients using the `defaultClient` object, such as
// overriding the host and port, timeout, etc.
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);
System.out.println(result);
apiInstance.fileIdGet(id);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#fooDtParamGet");
System.err.println("Exception when calling DefaultApi#fileIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
Expand All @@ -109,6 +106,8 @@ All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**fileIdGet**](docs/DefaultApi.md#fileIdGet) | **GET** /file/{id} |
*DefaultApi* | [**fileIdGetWithHttpInfo**](docs/DefaultApi.md#fileIdGetWithHttpInfo) | **GET** /file/{id} |
*DefaultApi* | [**fooDtParamGet**](docs/DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} |
*DefaultApi* | [**fooDtParamGetWithHttpInfo**](docs/DefaultApi.md#fooDtParamGetWithHttpInfo) | **GET** /foo/{dtParam} |
*DefaultApi* | [**uploadPost**](docs/DefaultApi.md#uploadPost) | **POST** /upload |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ paths:
x-content-type: multipart/form-data
x-accepts:
- application/json
/file/{id}:
get:
parameters:
- explode: false
in: path
name: id
required: true
schema:
type: string
style: simple
responses:
"200":
description: ok
x-accepts:
- application/json
components:
schemas:
Foo:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,143 @@ All URIs are relative to *http://localhost*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fileIdGet**](DefaultApi.md#fileIdGet) | **GET** /file/{id} | |
| [**fileIdGetWithHttpInfo**](DefaultApi.md#fileIdGetWithHttpInfo) | **GET** /file/{id} | |
| [**fooDtParamGet**](DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} | |
| [**fooDtParamGetWithHttpInfo**](DefaultApi.md#fooDtParamGetWithHttpInfo) | **GET** /foo/{dtParam} | |
| [**uploadPost**](DefaultApi.md#uploadPost) | **POST** /upload | |
| [**uploadPostWithHttpInfo**](DefaultApi.md#uploadPostWithHttpInfo) | **POST** /upload | |



## fileIdGet

> void fileIdGet(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 {
apiInstance.fileIdGet(id);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#fileIdGet");
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


null (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | ok | - |

## fileIdGetWithHttpInfo

> ApiResponse<Void> fileIdGetWithHttpInfo(id)



### Example

```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
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 {
ApiResponse<Void> response = apiInstance.fileIdGetWithHttpInfo(id);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#fileIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

### Parameters


| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | **String**| | |

### Return type


ApiResponse<Void>

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | ok | - |


## fooDtParamGet

> Foo fooDtParamGet(dtParam, dtQuery, dtCookie)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,110 @@ private File prepareDownloadFile(HttpResponse<InputStream> response) throws IOEx
return file;
}

/**
*
*
* @param id (required)
* @throws ApiException if fails to make API call
*/
public void fileIdGet(String id) throws ApiException {
fileIdGet(id, null);
}

/**
*
*
* @param id (required)
* @param headers Optional headers to include in the request
* @throws ApiException if fails to make API call
*/
public void fileIdGet(String id, Map<String, String> headers) throws ApiException {
fileIdGetWithHttpInfo(id, headers);
}

/**
*
*
* @param id (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> fileIdGetWithHttpInfo(String id) throws ApiException {
return fileIdGetWithHttpInfo(id, null);
}

/**
*
*
* @param id (required)
* @param headers Optional headers to include in the request
* @return ApiResponse&lt;Void&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> fileIdGetWithHttpInfo(String id, Map<String, String> headers) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = fileIdGetRequestBuilder(id, headers);
try {
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
InputStream localVarResponseBody = null;
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("fileIdGet", localVarResponse);
}
localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
if (localVarResponseBody != null) {
localVarResponseBody.readAllBytes();
}
return new ApiResponse<>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
null
);
} finally {
if (localVarResponseBody != null) {
localVarResponseBody.close();
}
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}

private HttpRequest.Builder fileIdGetRequestBuilder(String id, Map<String, String> headers) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling fileIdGet");
}

HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

String localVarPath = "/file/{id}"
.replace("{id}", ApiClient.urlEncode(id.toString()));

localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

localVarRequestBuilder.header("Accept", "application/json");

localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
// Add custom headers if provided
localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}

/**
*
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,11 @@ 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);
System.out.println(result);
apiInstance.fileIdGet(id);
} catch (HttpStatusCodeException e) {
System.err.println("Exception when calling DefaultApi#fooDtParamGet");
System.err.println("Exception when calling DefaultApi#fileIdGet");
System.err.println("Status code: " + e.getStatusCode().value());
System.err.println("Reason: " + e.getResponseBodyAsString());
System.err.println("Response headers: " + e.getResponseHeaders());
Expand All @@ -117,6 +114,7 @@ All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**fileIdGet**](docs/DefaultApi.md#fileIdGet) | **GET** /file/{id} |
*DefaultApi* | [**fooDtParamGet**](docs/DefaultApi.md#fooDtParamGet) | **GET** /foo/{dtParam} |
*DefaultApi* | [**uploadPost**](docs/DefaultApi.md#uploadPost) | **POST** /upload |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ paths:
x-content-type: multipart/form-data
x-accepts:
- application/json
/file/{id}:
get:
parameters:
- explode: false
in: path
name: id
required: true
schema:
type: string
style: simple
responses:
"200":
description: ok
x-accepts:
- application/json
components:
schemas:
Foo:
Expand Down
Loading
Loading