mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge 6a01b11285f7887b22a9b9584d46df067fa6ce9a into d6c46342693205f0dae441b45742d9c85d41cf33
This commit is contained in:
commit
c2cc9c437e
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "{{classname}}.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
@ -229,10 +232,16 @@ end:
|
||||
// query parameters
|
||||
{{^isArray}}
|
||||
char *keyQuery_{{{paramName}}} = NULL;
|
||||
{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}char *{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}char *{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueQuery_{{{paramName}}} {{#isString}}{{^isEnum}}= NULL{{/isEnum}}{{/isString}}{{#isInteger}}= NULL{{/isInteger}}{{#isBoolean}}= NULL{{/isBoolean}};
|
||||
{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}char *{{/isLong}}{{#isInteger}}char *{{/isInteger}}{{#isDouble}}char *{{/isDouble}}{{#isFloat}}char *{{/isFloat}}{{#isBoolean}}char *{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueQuery_{{{paramName}}} {{#isString}}{{^isEnum}}= NULL{{/isEnum}}{{/isString}}{{#isInteger}}= NULL{{/isInteger}}{{#isBoolean}}= NULL{{/isBoolean}};
|
||||
keyValuePair_t *keyPairQuery_{{paramName}} = 0;
|
||||
{{/isArray}}
|
||||
{{^isLong}}
|
||||
{{^isFloat}}
|
||||
{{^isDouble}}
|
||||
if ({{paramName}})
|
||||
{{/isDouble}}
|
||||
{{/isFloat}}
|
||||
{{/isLong}}
|
||||
{
|
||||
{{#isArray}}
|
||||
list_addElement(localVarQueryParameters,{{paramName}});
|
||||
@ -243,17 +252,45 @@ end:
|
||||
valueQuery_{{{paramName}}} = calloc(1,MAX_NUMBER_LENGTH);
|
||||
snprintf(valueQuery_{{{paramName}}}, MAX_NUMBER_LENGTH, "%d", *{{{paramName}}});
|
||||
{{/isInteger}}
|
||||
{{#isFloat}}
|
||||
valueQuery_{{{paramName}}} = calloc(1,TYPICAL_MAX_NUMBER_LENGTH_FLOAT);
|
||||
int s = snprintf(valueQuery_{{{paramName}}}, TYPICAL_MAX_NUMBER_LENGTH_FLOAT, "%.7e", {{{paramName}}});
|
||||
if (s >= 0 && s >= TYPICAL_MAX_NUMBER_LENGTH_FLOAT)
|
||||
{
|
||||
valueQuery_{{{paramName}}} = realloc(valueQuery_{{{paramName}}}, s+1);
|
||||
snprintf(valueQuery_{{{paramName}}}, s+1, "%.7e", {{{paramName}}});
|
||||
}
|
||||
{{/isFloat}}
|
||||
{{#isDouble}}
|
||||
valueQuery_{{{paramName}}} = calloc(1,TYPICAL_MAX_NUMBER_LENGTH_FLOAT);
|
||||
int s = snprintf(valueQuery_{{{paramName}}}, TYPICAL_MAX_NUMBER_LENGTH_FLOAT, "%.16e", {{{paramName}}});
|
||||
if (s >= 0 && s >= TYPICAL_MAX_NUMBER_LENGTH_FLOAT)
|
||||
{
|
||||
valueQuery_{{{paramName}}} = realloc(valueQuery_{{{paramName}}}, s+1);
|
||||
snprintf(valueQuery_{{{paramName}}}, s+1, "%.16e", {{{paramName}}});
|
||||
}
|
||||
{{/isDouble}}
|
||||
{{#isLong}}
|
||||
valueQuery_{{{paramName}}} = calloc(1,MAX_NUMBER_LENGTH_LONG);
|
||||
snprintf(valueQuery_{{{paramName}}}, MAX_NUMBER_LENGTH_LONG, "%d", {{{paramName}}});
|
||||
{{/isLong}}
|
||||
{{#isBoolean}}
|
||||
valueQuery_{{{paramName}}} = calloc(1,MAX_NUMBER_LENGTH);
|
||||
snprintf(valueQuery_{{{paramName}}}, MAX_NUMBER_LENGTH, "%d", *{{{paramName}}});
|
||||
{{/isBoolean}}
|
||||
{{^isInteger}}
|
||||
{{^isBoolean}}
|
||||
{{^isFloat}}
|
||||
{{^isDouble}}
|
||||
{{^isLong}}
|
||||
valueQuery_{{{paramName}}} = {{#isString}}{{^isEnum}}strdup({{/isEnum}}{{/isString}}({{{paramName}}}){{#isString}}{{^isEnum}}){{/isEnum}}{{/isString}};
|
||||
{{/isLong}}
|
||||
{{/isDouble}}
|
||||
{{/isFloat}}
|
||||
{{/isBoolean}}
|
||||
{{/isInteger}}
|
||||
keyPairQuery_{{paramName}} = keyValuePair_create(keyQuery_{{{paramName}}}, {{#isEnum}}strdup({{{operationId}}}_{{enumName}}_ToString(
|
||||
{{/isEnum}}{{^isString}}{{^isInteger}}{{^isBoolean}}&{{/isBoolean}}{{/isInteger}}{{/isString}}valueQuery_{{{paramName}}}{{#isEnum}})){{/isEnum}});
|
||||
{{/isEnum}}{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}{{^isLong}}{{^isBoolean}}&{{/isBoolean}}{{/isLong}}{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}valueQuery_{{{paramName}}}{{#isEnum}})){{/isEnum}});
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_{{paramName}});
|
||||
{{/isArray}}
|
||||
}
|
||||
|
@ -727,6 +727,40 @@ paths:
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
'/user/test_int32_int64_float_double':
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: test int32, int64 float and double query parameters in API
|
||||
description: This can test int32, int64 float and double query parameters in API.
|
||||
operationId: test_int32_int64_float_double
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: floatnum
|
||||
in: query
|
||||
description: A float number
|
||||
type: number
|
||||
format: float
|
||||
- name: doublenum
|
||||
in: query
|
||||
description: A double number
|
||||
type: number
|
||||
format: double
|
||||
- name: int32num
|
||||
in: query
|
||||
description: An int32 number
|
||||
type: integer
|
||||
format: int32
|
||||
- name: int64num
|
||||
in: query
|
||||
description: An int64 number
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
securityDefinitions:
|
||||
petstore_auth:
|
||||
type: oauth2
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "DefaultAPI.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
|
||||
// Returns private information.
|
||||
|
@ -92,6 +92,7 @@ Category | Method | HTTP request | Description
|
||||
*UserAPI* | [**UserAPI_getUserByName**](docs/UserAPI.md#UserAPI_getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
*UserAPI* | [**UserAPI_loginUser**](docs/UserAPI.md#UserAPI_loginUser) | **GET** /user/login | Logs user into the system
|
||||
*UserAPI* | [**UserAPI_logoutUser**](docs/UserAPI.md#UserAPI_logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*UserAPI* | [**UserAPI_testInt32Int64FloatDouble**](docs/UserAPI.md#UserAPI_testInt32Int64FloatDouble) | **GET** /user/test_int32_int64_float_double | test int32, int64 float and double query parameters in API
|
||||
*UserAPI* | [**UserAPI_testIntAndBool**](docs/UserAPI.md#UserAPI_testIntAndBool) | **GET** /user/testIntAndBool | test integer and boolean query parameters in API
|
||||
*UserAPI* | [**UserAPI_updateUser**](docs/UserAPI.md#UserAPI_updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "PetAPI.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
// Functions for enum STATUS for PetAPI_findPetsByStatus
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "StoreAPI.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
// Functions for enum RATING for StoreAPI_sendRating
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "UserAPI.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
|
||||
// Create user
|
||||
@ -594,6 +597,120 @@ end:
|
||||
|
||||
|
||||
|
||||
free(localVarPath);
|
||||
|
||||
}
|
||||
|
||||
// test int32, int64 float and double query parameters in API
|
||||
//
|
||||
// This can test int32, int64 float and double query parameters in API.
|
||||
//
|
||||
void
|
||||
UserAPI_testInt32Int64FloatDouble(apiClient_t *apiClient, float floatnum, double doublenum, int *int32num, long int64num)
|
||||
{
|
||||
list_t *localVarQueryParameters = list_createList();
|
||||
list_t *localVarHeaderParameters = NULL;
|
||||
list_t *localVarFormParameters = NULL;
|
||||
list_t *localVarHeaderType = NULL;
|
||||
list_t *localVarContentType = NULL;
|
||||
char *localVarBodyParameters = NULL;
|
||||
size_t localVarBodyLength = 0;
|
||||
|
||||
// clear the error code from the previous api call
|
||||
apiClient->response_code = 0;
|
||||
|
||||
// create the path
|
||||
char *localVarPath = strdup("/user/test_int32_int64_float_double");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_floatnum = NULL;
|
||||
char * valueQuery_floatnum ;
|
||||
keyValuePair_t *keyPairQuery_floatnum = 0;
|
||||
{
|
||||
keyQuery_floatnum = strdup("floatnum");
|
||||
valueQuery_floatnum = calloc(1,TYPICAL_MAX_NUMBER_LENGTH_FLOAT);
|
||||
int s = snprintf(valueQuery_floatnum, TYPICAL_MAX_NUMBER_LENGTH_FLOAT, "%.7e", floatnum);
|
||||
if (s >= 0 && s >= TYPICAL_MAX_NUMBER_LENGTH_FLOAT)
|
||||
{
|
||||
valueQuery_floatnum = realloc(valueQuery_floatnum, s+1);
|
||||
snprintf(valueQuery_floatnum, s+1, "%.7e", floatnum);
|
||||
}
|
||||
keyPairQuery_floatnum = keyValuePair_create(keyQuery_floatnum, valueQuery_floatnum);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_floatnum);
|
||||
}
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_doublenum = NULL;
|
||||
char * valueQuery_doublenum ;
|
||||
keyValuePair_t *keyPairQuery_doublenum = 0;
|
||||
{
|
||||
keyQuery_doublenum = strdup("doublenum");
|
||||
valueQuery_doublenum = calloc(1,TYPICAL_MAX_NUMBER_LENGTH_FLOAT);
|
||||
int s = snprintf(valueQuery_doublenum, TYPICAL_MAX_NUMBER_LENGTH_FLOAT, "%.16e", doublenum);
|
||||
if (s >= 0 && s >= TYPICAL_MAX_NUMBER_LENGTH_FLOAT)
|
||||
{
|
||||
valueQuery_doublenum = realloc(valueQuery_doublenum, s+1);
|
||||
snprintf(valueQuery_doublenum, s+1, "%.16e", doublenum);
|
||||
}
|
||||
keyPairQuery_doublenum = keyValuePair_create(keyQuery_doublenum, valueQuery_doublenum);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_doublenum);
|
||||
}
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_int32num = NULL;
|
||||
char * valueQuery_int32num = NULL;
|
||||
keyValuePair_t *keyPairQuery_int32num = 0;
|
||||
if (int32num)
|
||||
{
|
||||
keyQuery_int32num = strdup("int32num");
|
||||
valueQuery_int32num = calloc(1,MAX_NUMBER_LENGTH);
|
||||
snprintf(valueQuery_int32num, MAX_NUMBER_LENGTH, "%d", *int32num);
|
||||
keyPairQuery_int32num = keyValuePair_create(keyQuery_int32num, valueQuery_int32num);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_int32num);
|
||||
}
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_int64num = NULL;
|
||||
char * valueQuery_int64num ;
|
||||
keyValuePair_t *keyPairQuery_int64num = 0;
|
||||
{
|
||||
keyQuery_int64num = strdup("int64num");
|
||||
valueQuery_int64num = calloc(1,MAX_NUMBER_LENGTH_LONG);
|
||||
snprintf(valueQuery_int64num, MAX_NUMBER_LENGTH_LONG, "%d", int64num);
|
||||
keyPairQuery_int64num = keyValuePair_create(keyQuery_int64num, valueQuery_int64num);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_int64num);
|
||||
}
|
||||
apiClient_invoke(apiClient,
|
||||
localVarPath,
|
||||
localVarQueryParameters,
|
||||
localVarHeaderParameters,
|
||||
localVarFormParameters,
|
||||
localVarHeaderType,
|
||||
localVarContentType,
|
||||
localVarBodyParameters,
|
||||
localVarBodyLength,
|
||||
"GET");
|
||||
|
||||
// uncomment below to debug the error response
|
||||
//if (apiClient->response_code == 200) {
|
||||
// printf("%s\n","successful operation");
|
||||
//}
|
||||
//No return type
|
||||
end:
|
||||
if (apiClient->dataReceived) {
|
||||
free(apiClient->dataReceived);
|
||||
apiClient->dataReceived = NULL;
|
||||
apiClient->dataReceivedLen = 0;
|
||||
}
|
||||
list_freeList(localVarQueryParameters);
|
||||
|
||||
|
||||
|
||||
|
||||
free(localVarPath);
|
||||
|
||||
}
|
||||
|
@ -54,6 +54,14 @@ void
|
||||
UserAPI_logoutUser(apiClient_t *apiClient);
|
||||
|
||||
|
||||
// test int32, int64 float and double query parameters in API
|
||||
//
|
||||
// This can test int32, int64 float and double query parameters in API.
|
||||
//
|
||||
void
|
||||
UserAPI_testInt32Int64FloatDouble(apiClient_t *apiClient, float floatnum, double doublenum, int *int32num, long int64num);
|
||||
|
||||
|
||||
// test integer and boolean query parameters in API
|
||||
//
|
||||
// This can test integer and boolean query parameters in API.
|
||||
|
@ -11,6 +11,7 @@ Method | HTTP request | Description
|
||||
[**UserAPI_getUserByName**](UserAPI.md#UserAPI_getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**UserAPI_loginUser**](UserAPI.md#UserAPI_loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**UserAPI_logoutUser**](UserAPI.md#UserAPI_logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**UserAPI_testInt32Int64FloatDouble**](UserAPI.md#UserAPI_testInt32Int64FloatDouble) | **GET** /user/test_int32_int64_float_double | test int32, int64 float and double query parameters in API
|
||||
[**UserAPI_testIntAndBool**](UserAPI.md#UserAPI_testIntAndBool) | **GET** /user/testIntAndBool | test integer and boolean query parameters in API
|
||||
[**UserAPI_updateUser**](UserAPI.md#UserAPI_updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
@ -218,6 +219,39 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **UserAPI_testInt32Int64FloatDouble**
|
||||
```c
|
||||
// test int32, int64 float and double query parameters in API
|
||||
//
|
||||
// This can test int32, int64 float and double query parameters in API.
|
||||
//
|
||||
void UserAPI_testInt32Int64FloatDouble(apiClient_t *apiClient, float floatnum, double doublenum, int *int32num, long int64num);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**apiClient** | **apiClient_t \*** | context containing the client configuration |
|
||||
**floatnum** | **float** | A float number | [optional]
|
||||
**doublenum** | **double** | A double number | [optional]
|
||||
**int32num** | **int \*** | An int32 number | [optional]
|
||||
**int64num** | **long** | An int64 number | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **UserAPI_testIntAndBool**
|
||||
```c
|
||||
// test integer and boolean query parameters in API
|
||||
|
@ -92,6 +92,7 @@ Category | Method | HTTP request | Description
|
||||
*UserAPI* | [**UserAPI_getUserByName**](docs/UserAPI.md#UserAPI_getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
*UserAPI* | [**UserAPI_loginUser**](docs/UserAPI.md#UserAPI_loginUser) | **GET** /user/login | Logs user into the system
|
||||
*UserAPI* | [**UserAPI_logoutUser**](docs/UserAPI.md#UserAPI_logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*UserAPI* | [**UserAPI_testInt32Int64FloatDouble**](docs/UserAPI.md#UserAPI_testInt32Int64FloatDouble) | **GET** /user/test_int32_int64_float_double | test int32, int64 float and double query parameters in API
|
||||
*UserAPI* | [**UserAPI_testIntAndBool**](docs/UserAPI.md#UserAPI_testIntAndBool) | **GET** /user/testIntAndBool | test integer and boolean query parameters in API
|
||||
*UserAPI* | [**UserAPI_updateUser**](docs/UserAPI.md#UserAPI_updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "PetAPI.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
// Functions for enum STATUS for PetAPI_findPetsByStatus
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "StoreAPI.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
// Functions for enum RATING for StoreAPI_sendRating
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "UserAPI.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define TYPICAL_MAX_NUMBER_LENGTH_FLOAT 32
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
|
||||
// Create user
|
||||
@ -594,6 +597,120 @@ end:
|
||||
|
||||
|
||||
|
||||
free(localVarPath);
|
||||
|
||||
}
|
||||
|
||||
// test int32, int64 float and double query parameters in API
|
||||
//
|
||||
// This can test int32, int64 float and double query parameters in API.
|
||||
//
|
||||
void
|
||||
UserAPI_testInt32Int64FloatDouble(apiClient_t *apiClient, float floatnum, double doublenum, int *int32num, long int64num)
|
||||
{
|
||||
list_t *localVarQueryParameters = list_createList();
|
||||
list_t *localVarHeaderParameters = NULL;
|
||||
list_t *localVarFormParameters = NULL;
|
||||
list_t *localVarHeaderType = NULL;
|
||||
list_t *localVarContentType = NULL;
|
||||
char *localVarBodyParameters = NULL;
|
||||
size_t localVarBodyLength = 0;
|
||||
|
||||
// clear the error code from the previous api call
|
||||
apiClient->response_code = 0;
|
||||
|
||||
// create the path
|
||||
char *localVarPath = strdup("/user/test_int32_int64_float_double");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_floatnum = NULL;
|
||||
char * valueQuery_floatnum ;
|
||||
keyValuePair_t *keyPairQuery_floatnum = 0;
|
||||
{
|
||||
keyQuery_floatnum = strdup("floatnum");
|
||||
valueQuery_floatnum = calloc(1,TYPICAL_MAX_NUMBER_LENGTH_FLOAT);
|
||||
int s = snprintf(valueQuery_floatnum, TYPICAL_MAX_NUMBER_LENGTH_FLOAT, "%.7e", floatnum);
|
||||
if (s >= 0 && s >= TYPICAL_MAX_NUMBER_LENGTH_FLOAT)
|
||||
{
|
||||
valueQuery_floatnum = realloc(valueQuery_floatnum, s+1);
|
||||
snprintf(valueQuery_floatnum, s+1, "%.7e", floatnum);
|
||||
}
|
||||
keyPairQuery_floatnum = keyValuePair_create(keyQuery_floatnum, valueQuery_floatnum);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_floatnum);
|
||||
}
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_doublenum = NULL;
|
||||
char * valueQuery_doublenum ;
|
||||
keyValuePair_t *keyPairQuery_doublenum = 0;
|
||||
{
|
||||
keyQuery_doublenum = strdup("doublenum");
|
||||
valueQuery_doublenum = calloc(1,TYPICAL_MAX_NUMBER_LENGTH_FLOAT);
|
||||
int s = snprintf(valueQuery_doublenum, TYPICAL_MAX_NUMBER_LENGTH_FLOAT, "%.16e", doublenum);
|
||||
if (s >= 0 && s >= TYPICAL_MAX_NUMBER_LENGTH_FLOAT)
|
||||
{
|
||||
valueQuery_doublenum = realloc(valueQuery_doublenum, s+1);
|
||||
snprintf(valueQuery_doublenum, s+1, "%.16e", doublenum);
|
||||
}
|
||||
keyPairQuery_doublenum = keyValuePair_create(keyQuery_doublenum, valueQuery_doublenum);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_doublenum);
|
||||
}
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_int32num = NULL;
|
||||
char * valueQuery_int32num = NULL;
|
||||
keyValuePair_t *keyPairQuery_int32num = 0;
|
||||
if (int32num)
|
||||
{
|
||||
keyQuery_int32num = strdup("int32num");
|
||||
valueQuery_int32num = calloc(1,MAX_NUMBER_LENGTH);
|
||||
snprintf(valueQuery_int32num, MAX_NUMBER_LENGTH, "%d", *int32num);
|
||||
keyPairQuery_int32num = keyValuePair_create(keyQuery_int32num, valueQuery_int32num);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_int32num);
|
||||
}
|
||||
|
||||
// query parameters
|
||||
char *keyQuery_int64num = NULL;
|
||||
char * valueQuery_int64num ;
|
||||
keyValuePair_t *keyPairQuery_int64num = 0;
|
||||
{
|
||||
keyQuery_int64num = strdup("int64num");
|
||||
valueQuery_int64num = calloc(1,MAX_NUMBER_LENGTH_LONG);
|
||||
snprintf(valueQuery_int64num, MAX_NUMBER_LENGTH_LONG, "%d", int64num);
|
||||
keyPairQuery_int64num = keyValuePair_create(keyQuery_int64num, valueQuery_int64num);
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_int64num);
|
||||
}
|
||||
apiClient_invoke(apiClient,
|
||||
localVarPath,
|
||||
localVarQueryParameters,
|
||||
localVarHeaderParameters,
|
||||
localVarFormParameters,
|
||||
localVarHeaderType,
|
||||
localVarContentType,
|
||||
localVarBodyParameters,
|
||||
localVarBodyLength,
|
||||
"GET");
|
||||
|
||||
// uncomment below to debug the error response
|
||||
//if (apiClient->response_code == 200) {
|
||||
// printf("%s\n","successful operation");
|
||||
//}
|
||||
//No return type
|
||||
end:
|
||||
if (apiClient->dataReceived) {
|
||||
free(apiClient->dataReceived);
|
||||
apiClient->dataReceived = NULL;
|
||||
apiClient->dataReceivedLen = 0;
|
||||
}
|
||||
list_freeList(localVarQueryParameters);
|
||||
|
||||
|
||||
|
||||
|
||||
free(localVarPath);
|
||||
|
||||
}
|
||||
|
@ -54,6 +54,14 @@ void
|
||||
UserAPI_logoutUser(apiClient_t *apiClient);
|
||||
|
||||
|
||||
// test int32, int64 float and double query parameters in API
|
||||
//
|
||||
// This can test int32, int64 float and double query parameters in API.
|
||||
//
|
||||
void
|
||||
UserAPI_testInt32Int64FloatDouble(apiClient_t *apiClient, float floatnum, double doublenum, int *int32num, long int64num);
|
||||
|
||||
|
||||
// test integer and boolean query parameters in API
|
||||
//
|
||||
// This can test integer and boolean query parameters in API.
|
||||
|
@ -11,6 +11,7 @@ Method | HTTP request | Description
|
||||
[**UserAPI_getUserByName**](UserAPI.md#UserAPI_getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**UserAPI_loginUser**](UserAPI.md#UserAPI_loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**UserAPI_logoutUser**](UserAPI.md#UserAPI_logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**UserAPI_testInt32Int64FloatDouble**](UserAPI.md#UserAPI_testInt32Int64FloatDouble) | **GET** /user/test_int32_int64_float_double | test int32, int64 float and double query parameters in API
|
||||
[**UserAPI_testIntAndBool**](UserAPI.md#UserAPI_testIntAndBool) | **GET** /user/testIntAndBool | test integer and boolean query parameters in API
|
||||
[**UserAPI_updateUser**](UserAPI.md#UserAPI_updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
@ -218,6 +219,39 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **UserAPI_testInt32Int64FloatDouble**
|
||||
```c
|
||||
// test int32, int64 float and double query parameters in API
|
||||
//
|
||||
// This can test int32, int64 float and double query parameters in API.
|
||||
//
|
||||
void UserAPI_testInt32Int64FloatDouble(apiClient_t *apiClient, float floatnum, double doublenum, int *int32num, long int64num);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**apiClient** | **apiClient_t \*** | context containing the client configuration |
|
||||
**floatnum** | **float** | A float number | [optional]
|
||||
**doublenum** | **double** | A double number | [optional]
|
||||
**int32num** | **int \*** | An int32 number | [optional]
|
||||
**int64num** | **long** | An int64 number | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **UserAPI_testIntAndBool**
|
||||
```c
|
||||
// test integer and boolean query parameters in API
|
||||
|
Loading…
x
Reference in New Issue
Block a user