oaspec/codegen/server_request_decode

Types

pub type BodyFieldKind {
  BodyFieldUnknown
  BodyFieldString
  BodyFieldInt
  BodyFieldFloat
  BodyFieldBool
  BodyFieldStringArray
  BodyFieldIntArray
  BodyFieldFloatArray
  BodyFieldBoolArray
}

Constructors

  • BodyFieldUnknown
  • BodyFieldString
  • BodyFieldInt
  • BodyFieldFloat
  • BodyFieldBool
  • BodyFieldStringArray
  • BodyFieldIntArray
  • BodyFieldFloatArray
  • BodyFieldBoolArray
pub type DeepObjectProperty {
  DeepObjectProperty(
    name: String,
    field_name: String,
    schema_ref: schema.SchemaRef,
    required: Bool,
  )
}

Constructors

  • DeepObjectProperty(
      name: String,
      field_name: String,
      schema_ref: schema.SchemaRef,
      required: Bool,
    )

Values

pub fn body_field_kind(
  schema_ref: schema.SchemaRef,
  ctx: context.Context,
) -> BodyFieldKind
pub fn body_field_kind_needs_float(kind: BodyFieldKind) -> Bool
pub fn body_field_kind_needs_int(kind: BodyFieldKind) -> Bool
pub const bool_parse_expr: String

Expression that case-insensitively parses a string to Bool. Accepts “true”/“True”/“TRUE” etc. as True, everything else as False. This is compatible with Gleam’s bool.to_string which produces “True”/“False”.

pub fn cookie_optional_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
) -> String

Generate expression for an optional cookie parameter.

pub fn cookie_required_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
) -> String

Generate expression for a required cookie parameter.

pub fn deep_object_has_additional_properties(
  param: spec.Parameter(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn deep_object_has_untyped_additional_properties(
  param: spec.Parameter(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn deep_object_optional_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
  op_id: String,
  ctx: context.Context,
) -> String
pub fn deep_object_param_has_optional_fields(
  param: spec.Parameter(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn deep_object_param_needs_float(
  param: spec.Parameter(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn deep_object_param_needs_int(
  param: spec.Parameter(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn deep_object_param_needs_string(
  param: spec.Parameter(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn deep_object_required_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
  op_id: String,
  ctx: context.Context,
) -> String
pub fn form_urlencoded_body_constructor_expr(
  rb: spec.RequestBody(spec.Resolved),
  op_id: String,
  ctx: context.Context,
) -> String
pub fn form_urlencoded_body_has_nested_object(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn form_urlencoded_body_has_optional_fields(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn form_urlencoded_body_needs_float(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn form_urlencoded_body_needs_int(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn form_urlencoded_body_needs_string(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn generate_body_decode_expr(
  rb: spec.RequestBody(spec.Resolved),
  op_id: String,
  ctx: context.Context,
) -> String

Generate the body decode expression for a request body.

pub fn header_optional_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
) -> String

Generate expression for an optional header parameter.

pub fn header_required_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
) -> String

Generate expression for a required header parameter.

pub fn is_deep_object_param(
  param: spec.Parameter(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn multipart_body_constructor_expr(
  rb: spec.RequestBody(spec.Resolved),
  op_id: String,
  ctx: context.Context,
) -> String
pub fn multipart_body_has_optional_fields(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn multipart_body_needs_float(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn multipart_body_needs_int(
  rb: spec.RequestBody(spec.Resolved),
  ctx: context.Context,
) -> Bool
pub fn object_properties_from_schema_ref(
  schema_ref: schema.SchemaRef,
  ctx: context.Context,
) -> List(DeepObjectProperty)
pub fn operation_uses_form_urlencoded_body(
  operation: spec.Operation(spec.Resolved),
) -> Bool
pub fn operation_uses_multipart_body(
  operation: spec.Operation(spec.Resolved),
) -> Bool
pub fn param_parse_expr(
  var_name: String,
  param: spec.Parameter(spec.Resolved),
) -> String

Generate parse expression for a path parameter (already bound as String).

pub fn query_optional_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
) -> String

Generate expression for an optional query parameter.

pub fn query_optional_expr_with_schema(
  key: String,
  schema_ref: option.Option(schema.SchemaRef),
  explode: option.Option(Bool),
) -> String
pub fn query_required_expr(
  key: String,
  param: spec.Parameter(spec.Resolved),
) -> String

Generate expression for a required query parameter.

pub fn query_required_expr_with_schema(
  key: String,
  schema_ref: option.Option(schema.SchemaRef),
  explode: option.Option(Bool),
) -> String
pub fn query_schema_needs_float(
  schema_ref: option.Option(schema.SchemaRef),
) -> Bool
pub fn query_schema_needs_int(
  schema_ref: option.Option(schema.SchemaRef),
) -> Bool
pub fn query_schema_needs_string(
  schema_ref: option.Option(schema.SchemaRef),
) -> Bool
pub fn request_body_uses_form_urlencoded(
  rb: spec.RequestBody(spec.Resolved),
) -> Bool
pub fn request_body_uses_multipart(
  rb: spec.RequestBody(spec.Resolved),
) -> Bool
pub fn schema_ref_body_field_kind(
  schema_ref: option.Option(schema.SchemaRef),
  ctx: context.Context,
) -> BodyFieldKind
Search Document