mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +00:00
Added NRF
This commit is contained in:
parent
46f20cc979
commit
d0673e3066
397 changed files with 85455 additions and 209 deletions
71
lib/sbi/openapi/model/links_value_schema.c
Normal file
71
lib/sbi/openapi/model/links_value_schema.c
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "links_value_schema.h"
|
||||
|
||||
OpenAPI_links_value_schema_t *OpenAPI_links_value_schema_create(
|
||||
char *href
|
||||
)
|
||||
{
|
||||
OpenAPI_links_value_schema_t *links_value_schema_local_var = OpenAPI_malloc(sizeof(OpenAPI_links_value_schema_t));
|
||||
if (!links_value_schema_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
links_value_schema_local_var->href = href;
|
||||
|
||||
return links_value_schema_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_links_value_schema_free(OpenAPI_links_value_schema_t *links_value_schema)
|
||||
{
|
||||
if (NULL == links_value_schema) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(links_value_schema->href);
|
||||
ogs_free(links_value_schema);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_links_value_schema_convertToJSON(OpenAPI_links_value_schema_t *links_value_schema)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (links_value_schema == NULL) {
|
||||
ogs_error("OpenAPI_links_value_schema_convertToJSON() failed [LinksValueSchema]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (links_value_schema->href) {
|
||||
if (cJSON_AddStringToObject(item, "href", links_value_schema->href) == NULL) {
|
||||
ogs_error("OpenAPI_links_value_schema_convertToJSON() failed [href]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_links_value_schema_t *OpenAPI_links_value_schema_parseFromJSON(cJSON *links_value_schemaJSON)
|
||||
{
|
||||
OpenAPI_links_value_schema_t *links_value_schema_local_var = NULL;
|
||||
cJSON *href = cJSON_GetObjectItemCaseSensitive(links_value_schemaJSON, "href");
|
||||
|
||||
if (href) {
|
||||
if (!cJSON_IsString(href)) {
|
||||
ogs_error("OpenAPI_links_value_schema_parseFromJSON() failed [href]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
links_value_schema_local_var = OpenAPI_links_value_schema_create (
|
||||
href ? ogs_strdup(href->valuestring) : NULL
|
||||
);
|
||||
|
||||
return links_value_schema_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue