oas3-gen 0.23.1

A rust type generator for OpenAPI v3.1.x specification.
1
2
3
4
5
6
7
8
9
10
11
use oas3::spec::{Parameter, ParameterStyle};

/// Determine if a query parameter should use exploded form.
///
/// Returns `true` if the parameter explicitly sets `explode: true`, or if
/// `explode` is unset and the style is either unspecified or `form` (the default).
pub(crate) fn query_param_explode(param: &Parameter) -> bool {
  param
    .explode
    .unwrap_or(matches!(param.style, None | Some(ParameterStyle::Form)))
}