code: function hasExample ({ optional, example, details } = {}) {
    if (optional || example !== undefined) {
      return true;
    }
  
    if (details !== undefined) {
      const values = Object.keys(details).map((key) => details[key]);
  
      return values.every(hasExample);
    }
  
    return false;
  }
docs: Checks if a field definition has an example, or describes an object with fields that recursively have examples of their own, or is optional.