Amaury Graillat 6b1b5cc4c5
Update c curl generator to support float (#21103)
* [C-Curl] Client generator does not handle float properly (#21092)

- Change function signature to float*
- Change generator to convert float to string
- Similar change for double and long

* [C-Curl] Client generator does not handle float properly (#21092)

- Generate samples
- Fix generator for headers and path params

* Revert "[C-Curl] Client generator does not handle float properly (#21092)"

This reverts commit ba044a65d51d427fbccea8e8c0d14c50fab0579b.

* Revert "[C-Curl] Client generator does not handle float properly (#21092)"

This reverts commit f99c5b038276aed511f4e81cc8cec16acc6f085f.

* [C-Curl] Client generator does not handle float properly (#21092)

- Convert float, double and long to string
- Generate samples

* [C-Curl] Client generator does not handle float properly (#21092)

- Add missing yaml example file

* [C-Curl] Client generator does not handle float properly (#21092)

- Transfer float and double in scientific notation with resp. 7 and 16 decimals
- Adapt string size to number of required characters

* [C-Curl] Client generator does not handle float properly (#21092)

- Fix unused variable.
- Fix snprintf string

* * [C-Curl] Client generator does not handle float properly (#21092)

- Generating samples

* * [C-Curl] Client generator does not handle float properly (#21092)

- Always allocate the exact string size
2025-10-08 14:23:45 +08:00

81 lines
1.7 KiB
C

#include <stdlib.h>
#include <stdio.h>
#include "../include/apiClient.h"
#include "../include/list.h"
#include "../external/cJSON.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "../model/user.h"
// Create user
//
// This can only be done by the logged in user.
//
void
UserAPI_createUser(apiClient_t *apiClient, user_t *body);
// Creates list of users with given input array
//
void
UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t *body);
// Creates list of users with given input array
//
void
UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t *body);
// Delete user
//
// This can only be done by the logged in user.
//
void
UserAPI_deleteUser(apiClient_t *apiClient, char *username);
// Get user by user name
//
user_t*
UserAPI_getUserByName(apiClient_t *apiClient, char *username);
// Logs user into the system
//
char*
UserAPI_loginUser(apiClient_t *apiClient, char *username, char *password);
// Logs out current logged in user session
//
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.
//
void
UserAPI_testIntAndBool(apiClient_t *apiClient, int *keep, int *keepDay);
// Updated user
//
// This can only be done by the logged in user.
//
void
UserAPI_updateUser(apiClient_t *apiClient, char *username, user_t *body);