gilly/gilly
Types
Values
pub fn generate_code(
builder: Builder,
spec: openapi.OpenAPI,
) -> String
Generate Gleam code from an OpenAPI specification record. See’s gilly/openapi/openapi.gleam for more info on building OpenAPI records.
pub fn generate_code_from_file(
builder: Builder,
source: String,
) -> Result(String, @internal Error)
Generate Gleam code from an OpenAPI specification file.
Source should be a path to a JSON file containing the OpenAPI spec. Returns the generated code as a string, or an error if something goes wrong.
pub fn with_indent(builder: Builder, indent: Int) -> Builder
Indent configures the number of spaces used for indentation in the generated code.
pub fn with_optional_query_params(
builder: Builder,
optional_query_params: Bool,
) -> Builder
When setting optional_query_params to True, all query parameters in the generated client will be optional, regardless of whether they are marked as required in the OpenAPI spec or not.
This is useful for non-conforming OpenAPI specs or to allow more flexibility for SDK end-users.