Skip to content

Commit eba8583

Browse files
Adapted Avro and Cap'n Proto
1 parent b5144e5 commit eba8583

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/rfl/avro/to_schema.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ schema::Type type_to_avro_schema_type(
122122
}
123123
return schema::Type{.value = record};
124124

125+
} else if constexpr (std::is_same<T, Type::DefaultVal>()) {
126+
return type_to_avro_schema_type(*_t.type_, _definitions, _already_known,
127+
_num_unnamed);
128+
125129
} else if constexpr (std::is_same<T, Type::Optional>()) {
126130
return schema::Type{
127131
.value = std::vector<schema::Type>(

src/rfl/capnproto/to_schema.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ SOFTWARE.
3333
#include "rfl/capnproto/is_named_type.hpp"
3434
#include "rfl/capnproto/schema/CapnProtoTypes.hpp"
3535
#include "rfl/capnproto/schema/Type.hpp"
36-
//#include "rfl/internal/strings/strings.hpp"
37-
//#include "rfl/json.hpp"
36+
// #include "rfl/internal/strings/strings.hpp"
37+
// #include "rfl/json.hpp"
3838
#include "rfl/parsing/schemaful/tuple_to_object.hpp"
3939

4040
namespace rfl::capnproto {
@@ -210,6 +210,10 @@ schema::Type type_to_capnproto_schema_type(
210210
return object_to_capnproto_schema_type(_t, _definitions, _parent,
211211
_cnp_types);
212212

213+
} else if constexpr (std::is_same<T, Type::DefaultVal>()) {
214+
return type_to_capnproto_schema_type(*_t.type_, _definitions, _parent,
215+
_cnp_types);
216+
213217
} else if constexpr (std::is_same<T, Type::Optional>()) {
214218
return optional_to_capnproto_schema_type(_t, _definitions, _parent,
215219
_cnp_types);

0 commit comments

Comments
 (0)