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

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 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_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_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 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_needs_result_unwrap(
  param: spec.Parameter(spec.Resolved),
) -> Bool

Return true when the parse expression returns a Result that the router must unwrap (int/float parsing). Bool and string params are always safe.

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). Returns a safe expression that does not crash on invalid input. For types that need parsing (int, float), returns the raw parse call so the router can wrap it in a case expression for error handling.

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

Generate expression for an optional query parameter.

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

Generate expression for a required query parameter.

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