Skip to content

Log bad array on cannot support tuple-like arrays error #1381

@david-crespo

Description

@david-crespo

Without this it's hard to tell what the problem is.

fn j2oas_array(
array: &Option<Box<schemars::schema::ArrayValidation>>,
) -> openapiv3::ArrayType {
let arr = array.as_ref().unwrap();
openapiv3::ArrayType {
items: match &arr.items {
Some(schemars::schema::SingleOrVec::Single(schema)) => {
Some(box_reference_or(j2oas_schema(None, &schema)))
}
Some(schemars::schema::SingleOrVec::Vec(_)) => {
panic!("OpenAPI v3.0.x cannot support tuple-like arrays")
}
None => None,
},
min_items: arr.min_items.map(|n| n as usize),
max_items: arr.max_items.map(|n| n as usize),
unique_items: arr.unique_items.unwrap_or(false),
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions