Rust

JSON validators: any JSON value, JSON arrays, JSON objects, and Firebase Cloud Messaging credentials.

Contents

use utopia_validators::json::Array;
Rust
pub struct Array

A JSON array: a list, or a string that decodes to one, of at most length bytes when encoded (0 for any length).

An empty array counts as a list.

use utopia_validators::json::Fcm;
Rust
pub struct Fcm

Google service account credentials for the Firebase Cloud Messaging (FCM) HTTP v1 API: a map, an object, or a string that decodes to one.

The credentials need non-empty type (service_account), project_id, private_key (PEM-encoded), client_email (an email address) and token_uri fields. The other standard fields must be non-empty strings when present, and the URL fields HTTPS URLs. A failed validation describes the field that is wrong.

use utopia_validators::Json;
Rust
pub struct Json

An array, or a string that is valid JSON.

use utopia_validators::json::Object;
Rust
pub struct Object

A JSON object: an object, a map, or a string that decodes to an object, of at most length bytes when encoded (0 for any length).

An empty array counts as a map.