generate-swift
Generates Swift type definitions for the specified schema and writes them to the specified file. Typesync first “flattens” your schema, creating new aliases for inline types defined within. It then generates the primary and auxiliary structs, enums, aliases, etc. including encoders and decoders.
Usage
Options
The exact path or a Glob pattern to the definition file or files. Each definition file must be a YAML or JSON file containing model definitions.
- Example single file path:
definition/models.json
- Example Glob pattern:
'definition/**/*.yml'
The target environment for which the types are generated. This option specifies the target SDK and version, ensuring that the output is compatible with the chosen environment. See the list of available targets here.
The path to the output file.
Indentation or tab width for the generated code.
Whether to enable debug logs.
Targets
firebase@10
: For Swift projects that rely on the Firebase Apple SDK (v10).