code: function getExample (obj) {
    if (isArray(obj)) {
      return removeOptionalWithoutExamples(obj).map(getExample);
    }
  
    const { example, details } = obj;
  
    if (example === undefined && details !== undefined) {
      const nested = {};
  
      Object.keys(details).forEach((key) => {
        nested[key] = getExample(details[key]);
      });
  
      return nested;
    }
  
    return example;
  }
docs: Grabs JSON compatible