I get the following error message when I try to use tuple validation in my JSON schema Invalid schema for function 'save_address': In context=('properties', 'addresses'), array schema missing items
// Function to extract addresses from the HTML
function extractAddresses(html) {
const addresses = ;
const $ = cheerio.load(html);
// Find elements that contain addresses ('address').each((index, element) => {
const address = (element).text().trim();
addresses.push(address);
});
return addresses;
}
// Make a GET request to the web page
const url = ‘https://www.whitepages.com’;
axios.get(url)
.then(response => {
const html = response.data;
// Extract addresses from the HTML
const addresses = extractAddresses(html);
// Print the extracted addresses
addresses.forEach(address => {
console.log(address);
});
Sorry, no I’m not specifically interested in addresses. I just chose this because it’s what the JSON Schema docs have as an example for tuple validation.
Thank you, but this seems to only move the error into items. I still get the error
array schema missing items
It seems like an “items” property is always expected for an “array” schema, even though the JSON Schema docs outlines the use of “prefixItems” for tuples.