MCPcopy Create free account
hub / github.com/baerwang/openapi-rs / validate_array_items

Function validate_array_items

src/validator/mod.rs:357–370  ·  view source on GitHub ↗
(
    arr: &[Value],
    request: &Request,
    refs: &[&str],
    open_api: &OpenAPI,
)

Source from the content-addressed store, hash-verified

355}
356
357fn validate_array_items(
358 arr: &[Value],
359 request: &Request,
360 refs: &[&str],
361 open_api: &OpenAPI,
362) -> Result<()> {
363 for (index, item) in arr.iter().enumerate() {
364 let map = item
365 .as_object()
366 .with_context(|| format!("Array item at index {index} must be an object"))?;
367 validate_map(map, request, refs, open_api)?;
368 }
369 Ok(())
370}
371
372fn validate_array_length_with_schema(
373 length: usize,

Callers 1

bodyFunction · 0.85

Calls 1

validate_mapFunction · 0.85

Tested by

no test coverage detected