mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
support x-internal in models and operations (#17639)
This commit is contained in:
@@ -159,6 +159,7 @@ Class | Method | HTTP request | Description
|
||||
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
*ValuesApi* | [**getSomeValues**](docs/ValuesApi.md#getSomeValues) | **GET** /values | Get some primitive variable values
|
||||
*ValuesApi* | [**internalOnlyGet**](docs/ValuesApi.md#internalOnlyGet) | **GET** /internal/only | internal only
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
@@ -1316,6 +1316,23 @@ paths:
|
||||
tags:
|
||||
- values
|
||||
x-accepts: application/json
|
||||
/internal/only:
|
||||
get:
|
||||
description: ""
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Variable'
|
||||
description: successful operation
|
||||
"400":
|
||||
description: Invalid Value
|
||||
summary: internal only
|
||||
tags:
|
||||
- values
|
||||
x-internal: true
|
||||
x-accepts: application/json
|
||||
components:
|
||||
requestBodies:
|
||||
UserArray:
|
||||
@@ -2494,6 +2511,13 @@ components:
|
||||
type_:
|
||||
type: string
|
||||
type: object
|
||||
x-internal: false
|
||||
InteralOnly:
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
type: object
|
||||
x-internal: true
|
||||
AllOfModelArrayAnyOf:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Category'
|
||||
|
||||
@@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**getSomeValues**](ValuesApi.md#getSomeValues) | **GET** /values | Get some primitive variable values |
|
||||
| [**internalOnlyGet**](ValuesApi.md#internalOnlyGet) | **GET** /internal/only | internal only |
|
||||
|
||||
|
||||
<a id="getSomeValues"></a>
|
||||
@@ -66,3 +67,62 @@ No authorization required
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Value | - |
|
||||
|
||||
<a id="internalOnlyGet"></a>
|
||||
# **internalOnlyGet**
|
||||
> Variable internalOnlyGet()
|
||||
|
||||
internal only
|
||||
|
||||
|
||||
|
||||
### 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.ValuesApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
ValuesApi apiInstance = new ValuesApi(defaultClient);
|
||||
try {
|
||||
Variable result = apiInstance.internalOnlyGet();
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling ValuesApi#internalOnlyGet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**Variable**](Variable.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Value | - |
|
||||
|
||||
|
||||
@@ -189,4 +189,121 @@ public class ValuesApi {
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for internalOnlyGet
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
<tr><td> 400 </td><td> Invalid Value </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call internalOnlyGetCall(final ApiCallback _callback) throws ApiException {
|
||||
String basePath = null;
|
||||
// Operation Servers
|
||||
String[] localBasePaths = new String[] { };
|
||||
|
||||
// Determine Base Path to Use
|
||||
if (localCustomBaseUrl != null){
|
||||
basePath = localCustomBaseUrl;
|
||||
} else if ( localBasePaths.length > 0 ) {
|
||||
basePath = localBasePaths[localHostIndex];
|
||||
} else {
|
||||
basePath = null;
|
||||
}
|
||||
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/internal/only";
|
||||
|
||||
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>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
if (localVarContentType != null) {
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call internalOnlyGetValidateBeforeCall(final ApiCallback _callback) throws ApiException {
|
||||
return internalOnlyGetCall(_callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* internal only
|
||||
*
|
||||
* @return Variable
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
<tr><td> 400 </td><td> Invalid Value </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public Variable internalOnlyGet() throws ApiException {
|
||||
ApiResponse<Variable> localVarResp = internalOnlyGetWithHttpInfo();
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* internal only
|
||||
*
|
||||
* @return ApiResponse<Variable>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
<tr><td> 400 </td><td> Invalid Value </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<Variable> internalOnlyGetWithHttpInfo() throws ApiException {
|
||||
okhttp3.Call localVarCall = internalOnlyGetValidateBeforeCall(null);
|
||||
Type localVarReturnType = new TypeToken<Variable>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* internal only (asynchronously)
|
||||
*
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
<tr><td> 400 </td><td> Invalid Value </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call internalOnlyGetAsync(final ApiCallback<Variable> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = internalOnlyGetValidateBeforeCall(_callback);
|
||||
Type localVarReturnType = new TypeToken<Variable>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user