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, error.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_client_default_parameters(
builder: Builder,
client_default_parameters: List(String),
) -> Builder
Promote certain parameters (by name) to the Client type as defaults. When set, these parameters become optional on each Request and are automatically filled from the Client unless overridden per-request.
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.
pub fn with_optionality(
builder: Builder,
optionality: common.Optionality,
) -> Builder
Optionality determines how we decide which fields are optional in the generated code.