You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
810 B
C
31 lines
810 B
C
#include "../../object.h"
|
|
|
|
#define OBJ_TYPE struct ap_object
|
|
static struct json_object_field endpoints_layout[] = {
|
|
{
|
|
.key = "sharedInbox",
|
|
.offset = offsetof( OBJ_TYPE, endpoints.shared_inbox ),
|
|
.required = false,
|
|
.type = &json_field_string,
|
|
},
|
|
JSON_FIELD_END,
|
|
};
|
|
#undef OBJ_TYPE
|
|
|
|
static bool endpoints_writer( struct json_writer* jw, const char* field_name, void* field_data, struct json_object_field* layout_field_data )
|
|
{
|
|
struct ap_object* o = field_data;
|
|
if( o->endpoints.shared_inbox ) { goto write; }
|
|
return false;
|
|
write:
|
|
json_write_field_name(jw,field_name);
|
|
json_write_pretty_object_layout( jw, endpoints_layout, o );
|
|
return true;
|
|
}
|
|
|
|
struct json_field_type endpoints_type = {
|
|
.reader = json_field_object_composite_reader,
|
|
.writer = endpoints_writer,
|
|
.layout = endpoints_layout,
|
|
};
|