Skip to content

Schema

Schema represents an internal, abstract and somewhat "proxy" model of what is expected and what should be generated.

Technically speaking, it's a compiled version of Schema Input, which is provided by the client.

Internals

Schema (as an instance of Schema class) consists of:

  • Fields Definition - which fields should be generated, what resources has to be used to provide values, what values shall be generated for them and how these values expected to be modified. It not only uses Value Generators for retrieving a value for the field name, it also pipes the value through Value Pipes

  • Falsum Pipes - pipes modifying the generated object by this schema (more on Falsum Pipes)

  • Profiles - pregenerated values (uniquely for each falsum generation) being accessible from the value generators to maintain the result Falsum within a given context. For example when you generate an object representing a person born in Germany, the city of birth mustn't be Paris, his nationality will most likely remain german and his name will probably be Hans. See more on Profiles.

How is the Schema used

Schema is a root for Fabricator which uses it for Falsum fabrication. More on Fabricator