Skip to content

Definition does not have bundled schema #676

@r-barnes

Description

@r-barnes

I'm trying to use fbthrift in a project I'm open sourcing. I'm generating Thrift with the command below

fbthrift/bin/thrift1 --gen mstch_cpp2:json,schema,include_prefix=my_prefix -o my_prefix -I fbthrift/include my_prefix/Types.thrift

the project compiles fine, but, when I run it, it says

terminate called after throwing an instance of 'std::out_of_range'
  what():  Definition `my_project::MyDefinition` does not have bundled schema.
*** Aborted at 1760479126 (Unix time, try 'date -d @1760479126') ***

This is getting triggered from a stack with thrift/lib/cpp2/visitation/metadata.h:33:

  const metadata::ThriftStruct& meta =
      get_struct_metadata<folly::remove_cvref_t<T>>();

How can I cause Thrift to bundle the schema with its generated code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions