Gilly

Package Version Hex Docs

Generate Gleam SDKs from OpenAPI specifications.

Gilly is in early development:

  • many features from the OpenAPI specification are not yet supported
  • for now, generated code is not guaranteed not to break between Gilly releases

Feedback and contributions are very welcome!

Usage

Add Gilly as a dev dependency in your gleam.toml:

gleam add gilly --dev

Then, you can run Gilly from the command line:

gleam run -m gilly -- <path_to_openapi_spec.json> --output <output_path.gleam>

That’s it!

Flags

FlagShortDescriptionDefault
--output OUTPUT-oOutput file path (prints to stdout if omitted)None
--optionality OPTIONALITYHow to determine optional fields: RequiredOnly (only fields not listed as required are optional), NullableOnly (only fields marked nullable: true are optional), RequiredAndNullable (fields are optional if either not required or nullable)RequiredOnly
--indent INDENTNumber of spaces for indentation2
--optional-query-params-qMake all query parameters optional regardless of the specfalse
--help-hPrint help

Examples

Examples of generated clients can be found in the examples directory.

Development

gleam run   # Run the project
gleam test  # Run the tests

Releases

Releases are handled with goreleaser and GitHub Actions.

To dry-run a release, you can use:

goreleaser release --snapshot --skip=publish --clean

References

Search Document