#ifndef RFL_JSON_TOSCHEMA_HPP_ #define RFL_JSON_TOSCHEMA_HPP_ #if __has_include() #include #else #include "../thirdparty/yyjson.h" #endif #include // #include "../Literal.hpp" #include "../Processors.hpp" #include "../Variant.hpp" // #include "../parsing/schema/Type.hpp" // #include "../parsing/schema/ValidationType.hpp" #include "../parsing/schema/make.hpp" #include "Reader.hpp" #include "Writer.hpp" #include "schema/JSONSchema.hpp" // #include "schema/Type.hpp" // #include "write.hpp" #include "../common.hpp" namespace rfl::json { template struct TypeHelper {}; template struct TypeHelper> { using JSONSchemaType = rfl::Variant...>; }; RFL_API std::string to_schema_internal_schema( const parsing::schema::Definition& internal_schema, const yyjson_write_flag, const bool _no_required, const std::string& comment = ""); /// Returns the JSON schema for a class. template std::string to_schema(const yyjson_write_flag _flag = 0, const std::string& comment = "") { using P = Processors; const auto internal_schema = parsing::schema::make(); return to_schema_internal_schema(internal_schema, _flag, P::default_if_missing_, comment); } } // namespace rfl::json #endif