58 Commits

Author SHA1 Message Date
Ben Clayton
cdc19ac4d9 Serialization: Correctly encode structs with no fields
Empty structs were being serialized as `null`, when they should have been serialized as `{}`.

This was due to the type inference on the serializer - where no calls to `field()` would result in the default `null` type.

To solve this, the `serialize(const void* object, const std::initializer_list<Field>&)` inline helper has been promoted to a virtual function (and renamed to `fields()`).
The JSON serializer implementation of this now first sets the object type to `object`, even if there are no fields to serialize.

Added test for this.

Fixes: #10
2020-01-06 15:00:24 +00:00
Ben Clayton
3a10d4cabd Format all source files 2020-01-06 15:00:24 +00:00
Ben Clayton
d19d8f83c9
Address #7 nits and fix compiler warning (#9)
Compiler warning was signed / unsigned compare.
2019-12-31 21:04:57 +00:00
kuafuwang
73d697eac4 Fix Response type info, make response 'body' field optional
The `body` field of the Response is optional. Do not error if it is missing.

If the typeinfo of the response. This was incorrectly using the Request type.

Authored by kuafuwang, squashed by ben-clayton.
2019-12-31 20:58:33 +00:00
Ben Clayton
44d158805c Reimplement std::future and std::promise to workaround TSAN false positives 2019-11-14 08:10:16 +00:00
Ben Clayton
1f7f48904a Fix memory leak in src/socket.cpp 2019-11-14 00:37:38 +00:00
Ben Clayton
d13d4a4151 GCC build fixes 2019-11-14 00:29:38 +00:00
Ben Clayton
2dfd15462f Initial drop of cppdap 2019-11-08 21:58:50 +00:00