oaspec/codegen/client_response

Values

pub fn generate_multi_content_response(
  sb: string_tree.StringTree,
  status_code: http.HttpStatusCode,
  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: http.HttpStatusCode,
  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: http.HttpStatusCode,
  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.

Search Document