mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Validate C# json/object-api options (#6985)
This commit is contained in:
@@ -184,6 +184,8 @@ std::string FlatCompiler::GetUsageString(const char *program_name) const {
|
||||
" data using schema-less FlexBuffers.\n"
|
||||
" --no-warnings Inhibit all warning messages.\n"
|
||||
" --cs-global-alias Prepend \"global::\" to all user generated csharp classes and structs.\n"
|
||||
" --cs-gen-json-serializer Allows (de)serialization of JSON text in the Object\n"
|
||||
" API. (requires --gen-object-api).\n"
|
||||
"FILEs may be schemas (must end in .fbs), binary schemas (must end in .bfbs),\n"
|
||||
"or JSON files (conforming to preceding schema). FILEs after the -- must be\n"
|
||||
"binary flatbuffer format files.\n"
|
||||
@@ -435,6 +437,12 @@ int FlatCompiler::Compile(int argc, const char **argv) {
|
||||
Error("no options: specify at least one generator.", true);
|
||||
}
|
||||
|
||||
if (opts.cs_gen_json_serializer && !opts.generate_object_based_api) {
|
||||
Error(
|
||||
"--cs-gen-json-serializer requires --gen-object-api to be set as "
|
||||
"well.");
|
||||
}
|
||||
|
||||
flatbuffers::Parser conform_parser;
|
||||
if (!conform_to_schema.empty()) {
|
||||
std::string contents;
|
||||
|
||||
Reference in New Issue
Block a user