Validates that a parsed app.json structure meets the requirements for a
Shinylive application. Checks for proper list structure, required fields,
and non-empty content. Provides detailed error messages when validation fails.
Value
Logical TRUE if validation passes. If validation fails, throws an error with detailed information about the validation failure using cli_abort().
Validation Rules
The function checks these requirements:
json_datamust be a listjson_datamust contain at least one elementEach element must be a list (representing a file)
Each file list must contain all required fields:
namecontenttype
Error Messages
The function provides detailed error messages for these cases:
Not a list: "Expected a list or array of files"
Empty list: "File list is empty"
Invalid file entry: "Each entry must be a file object"
Missing fields: Lists specific missing required fields
Expected JSON Structure
The expected JSON structure is an array of objects, where each object represents a file in the application.
See also
find_shinylive_app_json()which uses this validation