oaspec/codegen/client_response
Values
pub fn array_item_to_string_fn(
items: schema.SchemaRef,
ctx: context.Context,
) -> String
Return a function expression that converts an array item to String.
Used in generated code: list.map(param, <fn>).
pub fn deep_object_array_item_to_string(
prop_ref: schema.SchemaRef,
ctx: context.Context,
) -> String
Convert a deepObject array item to a string expression.
pub fn generate_multi_content_response(
sb: string_tree.StringTree,
status_code: String,
variant_name: String,
content_entries: List(#(String, spec.MediaType)),
op_id: String,
ctx: context.Context,
) -> string_tree.StringTree
Generate response handling for multiple content types. Since the response variant uses String for multi-content (to stay type-safe), all branches return resp.body directly.
pub fn generate_single_content_response(
sb: string_tree.StringTree,
status_code: String,
variant_name: String,
media_type_name: String,
media_type: spec.MediaType,
op_id: String,
ctx: context.Context,
) -> string_tree.StringTree
Generate response handling for a single content type.
pub fn get_response_decode_expr(
schema_ref: schema.SchemaRef,
op_id: String,
status_code: String,
ctx: context.Context,
) -> String
Get the decode expression for a response body.
pub fn inline_schema_to_decoder(s: schema.SchemaObject) -> String
Convert an inline schema to a decoder expression for use in generated client. Uses dyn_decode (gleam/dynamic/decode) to avoid collision with the generated decode module.