Zod Schema Null Handling
Zod Schema Null Handling
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 1/27
date: z.string(),
description: z.string()
})).optional(),
projects: z.array(z.object({
name: z.string(),
description: z.string(),
technologies: z.array(z.string()),
role: z.string(),
link: z.string().optional(),
achievements: z.array(z.string()).optional()
})).optional(),
languages: z.array(z.string()).optional(),
awards: z.array(z.object({
title: z.string(),
issuer: z.string(),
date: z.string(),
description: z.string()
})).optional(),
publications: z.array(z.object({
title: z.string(),
publisher: z.string(),
date: z.string(),
link: z.string().optional(),
summary: z.string()
})).optional()
});
\s*$/gi, '')
.replace(/^
\s*/gi, '')
.replace(/\s*
$/gi, '')
.trim();
return cleaned;
}
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 2/27
export async function main(text) {
try {
const completion = await openai.chat.completions.create({
model: "gemini-2.5-flash-lite",
messages: [
{
role: "system",
content: You are a professional resume generator. You MUST return ONLY valid JSON (no
markdown, no explanations, no code blocks) in this exact format:
{
"full_name": "Full Name",
"headline": "Professional Title/Headline",
"contact_information": {
"email": "email@example.com",
"phone": "+1-xxx-xxx-xxxx",
"address": "City, State, Country",
"linkedin": "linkedin.com/in/profile",
"website": "website.com",
"github": "github.com/username"
},
"summary": "Professional summary paragraph",
"experience": [
{
"job_title": "Job Title",
"company": "Company Name",
"location": "City, State",
"start_date": "Month Year",
"end_date": "Month Year or Present",
"description": "Detailed job description",
"achievements": ["Achievement 1", "Achievement 2"],
"technologies_used": ["Tech1", "Tech2"]
}
],
"education": [
{
"degree": "Degree Type",
"institution": "School Name",
"location": "City, State",
"start_date": "Month Year",
"end_date": "Month Year",
"description": "Education details"
}
],
"skills": ["Skill1", "Skill2", "Skill3"],
"certifications": [
{
"name": "Certification Name",
"issuer": "Issuing Organization",
"date": "Month Year",
"description": "Certification details"
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 3/27
}
],
"projects": [
{
"name": "Project Name",
"description": "Project description",
"technologies": ["Tech1", "Tech2"],
"role": "Your role",
"link": "project-url.com",
"achievements": ["Achievement 1"]
}
],
"languages": ["English", "Other languages"],
"awards": [
{
"title": "Award Title",
"issuer": "Issuing Organization",
"date": "Month Year",
"description": "Award description"
}
],
"publications": [
{
"title": "Publication Title",
"publisher": "Publisher Name",
"date": "Month Year",
"link": "publication-url.com",
"summary": "Publication summary"
}
]
}
Create comprehensive, realistic details for missing information. Return ONLY the JSON object.
},
{
role: "user",
// content: "PTM, node js developer"
content: text
}
],
temperature: 0.3,
max_tokens: 4000
});
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 4/27
const parsed = JSON.parse(cleanedText);
const validated = ResumeSchema.parse(parsed);
} catch (error) {
console.error("❌ Error:", error);
if (error instanceof z.ZodError) {
console.error("Validation errors:", error.errors);
}
throw error;
}
}
Raw response:
json
{
"full_name": "Yash Purani",
"headline": "Full Stack Developer",
"contact_information": {
"email": "contact@yashpurani.com",
"phone": "+91-7600160052",
"address": "Vadodara, Gujarat, India",
"linkedin": "linkedin.com/in/yashpurani",
"website": "yashpurani.com",
"github": "github.com/yash-js"
},
"summary": "Dedicated Full Stack Developer with over 3.5 years of experience designing and
delivering high-performance applications. Proficient in full-stack development, database
management, and test automation. Passionate about creating efficient, scalable solutions and
contributing to team success, with a strong focus on React and Node.js.",
"experience": [
{
"job_title": "Software Development Engineer (SDE)",
"company": "Zentosys Solutions PVT.LTD",
"location": "Pune, India",
"start_date": "May 2024",
"end_date": "February 2025",
"description": "Developing and maintaining the on-demand laundry app for the Saudi
Arabian market, ensuring high performance and responsiveness. Optimized backend processes,
reducing server response time by 45%, which significantly improved overall application
performance. Collaborated with cross-functional teams to design, develop, and deploy new
functionalities, driving higher user engagement and satisfaction.",
"achievements": [
"Optimized backend processes, reducing server response time by 45%.",
"Contributed to the successful development and deployment of new features, enhancing
user engagement."
],
"technologies_used": ["React", "Node.js", "Express", "MongoDB", "AWS", "Docker"]
},
{
"job_title": "Full Stack Developer",
"company": "Proses Web Technologies Pvt Ltd.",
"location": "Vadodara, India",
"start_date": "September 2023",
"end_date": "February 2024",
"description": "Developed high-quality applications using React, React Native,
Next.js, and Node.js. Ensured robustness and responsiveness of applications. Managed
database operations with MySQL and Sequelize.",
"achievements": [
"Delivered robust and responsive applications using modern web technologies.",
"Successfully managed database operations, ensuring data integrity and efficient
retrieval."
],
"technologies_used": ["React", "React Native", "Next.js", "Node.js", "Express",
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 5/27
"MySQL", "Sequelize", "Tailwind CSS"]
},
{
"job_title": "Associate Software Engineer",
"company": "Mahitech LLC",
"location": "Vadodara, India",
"start_date": "July 2021",
"end_date": "August 2023",
"description": "Developed software applications using React, React Native, and
Node.js. Utilized AWS for cloud services. Employed Agile methodology for software
development.",
"achievements": [
"Developed and launched multiple software applications utilizing React, React
Native, and Node.js.",
"Leveraged AWS services for scalable and reliable cloud infrastructure.",
"Successfully implemented Agile methodologies, improving team collaboration and
project delivery speed."
],
"technologies_used": ["React", "React Native", "Node.js", "Express", "AWS", "Git",
"JIRA"]
}
],
"education": [
{
"degree": "Bachelor’s in Computer Application",
"institution": "K.J. Institute of Technology",
"location": "Savli, Vadodara, India",
"start_date": "August 2018",
"end_date": "September 2021",
"description": "Completed Bachelor's degree focusing on computer applications and
software development principles."
}
],
"skills": [
"React",
"React Native",
"Next.js",
"Node.js",
"Express",
"Sequelize",
"Tailwind CSS",
"Rust",
"MongoDB",
"MySQL",
"IoT",
"Firebase",
"Git",
"JIRA",
"Cypress",
"Material UI",
"HTML Canvas",
"Redis",
"Docker",
"Prisma",
"Redux",
"Strapi",
"Java"
],
"certifications": [],
"projects": [
{
"name": "YellowWallDog",
"description": "An online store where artists can sell their unique creations,
including paintings, digital prints, journals, handmade stickers, greeting cards, and more.
Built with the MERN stack and deployed on an Ubuntu server, the platform offers a seamless
shopping experience for art lovers and a dedicated space for creators to showcase their
work.",
"technologies": ["MongoDB", "Express", "React", "Node.js", "Ubuntu"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Developed a fully functional e-commerce platform for artists.",
"Implemented a seamless user experience for both buyers and sellers."
]
},
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 6/27
{
"name": "Blog Hive - Multi-Tenant Blogging SaaS",
"description": "A multi-tenant blogging SaaS application built using modern
technologies. Blog Hive allows users to create and manage their own blogs with unique
subdirectories, secure authentication, and seamless payment integration. The platform is
designed for high performance, scalability, and a smooth user experience.",
"technologies": ["React", "Next.js", "Node.js", "Express", "PostgreSQL", "Stripe
API"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Created a scalable multi-tenant SaaS application.",
"Integrated secure authentication and payment processing."
]
},
{
"name": "TaskScape - Kanban Task Management",
"description": "A powerful task management tool, similar to Trello, that allows users
to create organizations, boards, and manage tasks using an intuitive Kanban board system.
Built with modern web technologies, TaskScape ensures smooth collaboration and efficient
workflow management for teams and individuals.",
"technologies": ["React", "Node.js", "Express", "MongoDB", "Material UI"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Developed an intuitive Kanban task management tool.",
"Facilitated efficient workflow management and team collaboration."
]
}
],
"languages": ["English", "Hindi", "Gujarati"],
"awards": [],
"publications": []
}
Cleaned JSON: {
"full_name": "Yash Purani",
"headline": "Full Stack Developer",
"contact_information": {
"email": "contact@yashpurani.com",
"phone": "+91-7600160052",
"address": "Vadodara, Gujarat, India",
"linkedin": "linkedin.com/in/yashpurani",
"website": "yashpurani.com",
"github": "github.com/yash-js"
},
"summary": "Dedicated Full Stack Developer with over 3.5 years of experience designing and
delivering high-performance applications. Proficient in full-stack development, database
management, and test automation. Passionate about creating efficient, scalable solutions and
contributing to team success, with a strong focus on React and Node.js.",
"experience": [
{
"job_title": "Software Development Engineer (SDE)",
"company": "Zentosys Solutions PVT.LTD",
"location": "Pune, India",
"start_date": "May 2024",
"end_date": "February 2025",
"description": "Developing and maintaining the on-demand laundry app for the Saudi
Arabian market, ensuring high performance and responsiveness. Optimized backend
processes, reducing server response time by 45%, which significantly improved overall
application performance. Collaborated with cross-functional teams to design, develop, and
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 7/27
deploy new functionalities, driving higher user engagement and satisfaction.",
"achievements": [
"Optimized backend processes, reducing server response time by 45%.",
"Contributed to the successful development and deployment of new features, enhancing
user engagement."
],
"technologies_used": ["React", "Node.js", "Express", "MongoDB", "AWS", "Docker"]
},
{
"job_title": "Full Stack Developer",
"company": "Proses Web Technologies Pvt Ltd.",
"location": "Vadodara, India",
"start_date": "September 2023",
"end_date": "February 2024",
"description": "Developed high-quality applications using React, React Native, Next.js, and
Node.js. Ensured robustness and responsiveness of applications. Managed database operations
with MySQL and Sequelize.",
"achievements": [
"Delivered robust and responsive applications using modern web technologies.",
"Successfully managed database operations, ensuring data integrity and efficient retrieval."
],
"technologies_used": ["React", "React Native", "Next.js", "Node.js", "Express", "MySQL",
"Sequelize", "Tailwind CSS"]
},
{
"job_title": "Associate Software Engineer",
"company": "Mahitech LLC",
"location": "Vadodara, India",
"start_date": "July 2021",
"end_date": "August 2023",
"description": "Developed software applications using React, React Native, and Node.js.
Utilized AWS for cloud services. Employed Agile methodology for software development.",
"achievements": [
"Developed and launched multiple software applications utilizing React, React Native, and
Node.js.",
"Leveraged AWS services for scalable and reliable cloud infrastructure.",
"Successfully implemented Agile methodologies, improving team collaboration and project
delivery speed."
],
"technologies_used": ["React", "React Native", "Node.js", "Express", "AWS", "Git", "JIRA"]
}
],
"education": [
{
"degree": "Bachelor’s in Computer Application",
"institution": "K.J. Institute of Technology",
"location": "Savli, Vadodara, India",
"start_date": "August 2018",
"end_date": "September 2021",
"description": "Completed Bachelor's degree focusing on computer applications and
software development principles."
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 8/27
}
],
"skills": [
"React",
"React Native",
"Next.js",
"Node.js",
"Express",
"Sequelize",
"Tailwind CSS",
"Rust",
"MongoDB",
"MySQL",
"IoT",
"Firebase",
"Git",
"JIRA",
"Cypress",
"Material UI",
"HTML Canvas",
"Redis",
"Docker",
"Prisma",
"Redux",
"Strapi",
"Java"
],
"certifications": [],
"projects": [
{
"name": "YellowWallDog",
"description": "An online store where artists can sell their unique creations, including
paintings, digital prints, journals, handmade stickers, greeting cards, and more. Built with the
MERN stack and deployed on an Ubuntu server, the platform offers a seamless shopping
experience for art lovers and a dedicated space for creators to showcase their work.",
"technologies": ["MongoDB", "Express", "React", "Node.js", "Ubuntu"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Developed a fully functional e-commerce platform for artists.",
"Implemented a seamless user experience for both buyers and sellers."
]
},
{
"name": "Blog Hive - Multi-Tenant Blogging SaaS",
"description": "A multi-tenant blogging SaaS application built using modern technologies.
Blog Hive allows users to create and manage their own blogs with unique subdirectories, secure
authentication, and seamless payment integration. The platform is designed for high
performance, scalability, and a smooth user experience.",
"technologies": ["React", "Next.js", "Node.js", "Express", "PostgreSQL", "Stripe API"],
"role": "Full Stack Developer",
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 9/27
"link": null,
"achievements": [
"Created a scalable multi-tenant SaaS application.",
"Integrated secure authentication and payment processing."
]
},
{
"name": "TaskScape - Kanban Task Management",
"description": "A powerful task management tool, similar to Trello, that allows users to create
organizations, boards, and manage tasks using an intuitive Kanban board system. Built with
modern web technologies, TaskScape ensures smooth collaboration and efficient workflow
management for teams and individuals.",
"technologies": ["React", "Node.js", "Express", "MongoDB", "Material UI"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Developed an intuitive Kanban task management tool.",
"Facilitated efficient workflow management and team collaboration."
]
}
],
"languages": ["English", "Hindi", "Gujarati"],
"awards": [],
"publications": []
}
❌ Error: ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"projects",
0,
"link"
],
"message": "Expected string, received null"
},
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"projects",
1,
"link"
],
"message": "Expected string, received null"
},
{
"code": "invalid_type",
"expected": "string",
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 10/27
"received": "null",
"path": [
"projects",
2,
"link"
],
"message": "Expected string, received null"
}
]
at get error (C:\Users\Developer\Documents\cv-builder-
backend\node_modules\zod\v3\types.cjs:45:31)
at ZodObject.parse (C:\Users\Developer\Documents\cv-builder-
backend\node_modules\zod\v3\types.cjs:120:22)
at main (C:\Users\Developer\Documents\cv-builder-backend\src\openai.ts:193:36)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
issues: [
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [Array],
message: 'Expected string, received null'
},
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [Array],
message: 'Expected string, received null'
},
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [Array],
message: 'Expected string, received null'
}
],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
errors: [
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [Array],
message: 'Expected string, received null'
},
{
code: 'invalid_type',
expected: 'string',
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 11/27
received: 'null',
path: [Array],
message: 'Expected string, received null'
},
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [Array],
message: 'Expected string, received null'
}
]
}
Validation errors: [
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [ 'projects', 0, 'link' ],
message: 'Expected string, received null'
},
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [ 'projects', 1, 'link' ],
message: 'Expected string, received null'
},
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [ 'projects', 2, 'link' ],
message: 'Expected string, received null'
}
]
Failed to generate resume: [
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"projects",
0,
"link"
],
"message": "Expected string, received null"
},
{
"code": "invalid_type",
"expected": "string",
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 12/27
"received": "null",
"path": [
"projects",
1,
"link"
],
"message": "Expected string, received null"
},
{
"code": "invalid_type",
"expected": "string",
"received": "null",
"path": [
"projects",
2,
"link"
],
"message": "Expected string, received null"
}
]
ts
link: z.string().optional()
but in your AI response "link": null — and null is not the same as undefined in Zod.
When .optional() is used, Zod accepts undefined but not null.
ts
link: z.string().nullable().optional()
ts
function removeNulls(obj) {
if (Array.isArray(obj)) {
return obj.map(removeNulls);
} else if (obj && typeof obj === "object") {
return Object.fromEntries(
Object.entries(obj).map(([k, v]) => [k, v === null ? undefined : removeNulls(v)])
);
}
return obj;
}
Recommendation
Since "link" is optional but may be missing in many AI outputs, Option 1 is the simplest.
Update your schema:
ts
link: z.string().nullable().optional()
If you want, I can also tweak your schema so all optional fields gracefully accept null values so you
don’t run into this again. That would make your pipeline more robust for imperfect AI JSON.
Got it — here’s your updated full Zod schema so it accepts both null and undefined for optional fields
like linkedin, website, github, link, etc.
This will make your resume generator more tolerant of AI outputs where some fields come back as null.
ts
What’s changed
If you want, I can also make this schema auto-strip null values to undefined so your final object is
always clean and doesn’t contain null.
That would make it even easier to handle in your frontend.
after that
Cleaned JSON: {
"full_name": "Yash Purani",
"headline": "Full Stack Developer | React Specialist",
"contact_information": {
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 15/27
"email": "contact@yashpurani.com",
"phone": "+91-7600160052",
"address": "Vadodara, Gujarat, India",
"linkedin": "linkedin.com/in/yashpurani",
"website": "yashpurani.com",
"github": "github.com/yash-js"
},
"summary": "Dedicated Full Stack Developer with over 3.5 years of experience designing and
delivering high-performance applications. Proficient in front-end development with React, React
Native, and Next.js, and skilled in back-end development using Node.js, Express, and database
management with MySQL and MongoDB. Experienced in cloud services (AWS), Agile
methodologies, and test automation (Cypress). Passionate about creating efficient, scalable
solutions and contributing to team success.",
"experience": [
{
"job_title": "Software Development Engineer (SDE)",
"company": "Zentosys Solutions PVT. LTD",
"location": "Pune, India",
"start_date": "May 2024",
"end_date": "February 2025",
"description": "Developing and maintaining the on-demand laundry app for the Saudi
Arabian market, ensuring high performance and responsiveness. Optimized backend
processes, reducing server response time by 45%, which significantly improved overall
application performance. Collaborated with cross-functional teams to design, develop, and
deploy new functionalities, driving higher user engagement and satisfaction.",
"achievements": [
"Reduced server response time by 45% through backend process optimization.",
"Contributed to the successful deployment of new features, enhancing user engagement."
],
"technologies_used": [
"React",
"Node.js",
"Express",
"MongoDB",
"AWS",
"Cypress"
]
},
{
"job_title": "Full Stack Developer",
"company": "Proses Web Technologies Pvt Ltd.",
"location": "Vadodara, India",
"start_date": "September 2023",
"end_date": "February 2024",
"description": "Developed high-quality applications using React, React Native, Next.js, and
Node.js. Ensured robustness and responsiveness of applications. Managed database operations
with MySQL and Sequelize.",
"achievements": [
"Delivered robust and responsive applications across multiple platforms.",
"Successfully managed database operations, ensuring data integrity and efficient retrieval."
],
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 16/27
"technologies_used": [
"React",
"React Native",
"Next.js",
"Node.js",
"Express",
"MySQL",
"Sequelize",
"Tailwind CSS"
]
},
{
"job_title": "Associate Software Engineer",
"company": "Mahitech LLC",
"location": "Vadodara, India",
"start_date": "July 2021",
"end_date": "August 2023",
"description": "Developed software applications using React, React Native, and Node.js.
Utilized AWS for cloud services. Employed Agile methodology for software development.",
"achievements": [
"Contributed to the development of multiple software applications, enhancing product
offerings.",
"Gained practical experience with AWS cloud services for application deployment and
management.",
"Successfully worked within an Agile framework, participating in sprints and contributing to
iterative development."
],
"technologies_used": [
"React",
"React Native",
"Node.js",
"AWS",
"Git",
"JIRA"
]
}
],
"education": [
{
"degree": "Bachelor’s in Computer Application",
"institution": "K.J. Institute of Technology",
"location": "Savli, Vadodara, India",
"start_date": "August 2018",
"end_date": "September 2021",
"description": "Completed a comprehensive program focused on computer science
fundamentals, software development, and application design."
}
],
"skills": [
"React",
"React Native",
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 17/27
"Next.js",
"Node.js",
"Express",
"Sequelize",
"Tailwind CSS",
"Rust",
"MongoDB",
"MySQL",
"IoT",
"Firebase",
"Git",
"JIRA",
"Cypress",
"Material UI",
"HTML Canvas",
"Redis",
"Docker",
"Prisma",
"Redux",
"Strapi",
"Java"
],
"certifications": [],
"projects": [
{
"name": "YellowWallDog",
"description": "An online store where artists can sell their unique creations, including
paintings, digital prints, journals, handmade stickers, greeting cards, and more. Built with the
MERN stack and deployed on an Ubuntu server, the platform offers a seamless shopping
experience for art lovers and a dedicated space for creators to showcase their work.",
"technologies": [
"MongoDB",
"Express",
"React",
"Node.js",
"Ubuntu"
],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Developed a fully functional e-commerce platform for artists.",
"Implemented user-friendly interface for both buyers and sellers."
]
},
{
"name": "Blog Hive - Multi-Tenant Blogging SaaS",
"description": "A multi-tenant blogging SaaS application built using modern technologies.
Blog Hive allows users to create and manage their own blogs with unique subdirectories, secure
authentication, and seamless payment integration. The platform is designed for high
performance, scalability, and a smooth user experience.",
"technologies": [
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 18/27
"React",
"Node.js",
"Express",
"PostgreSQL",
"Stripe API"
],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Engineered a scalable multi-tenant SaaS application.",
"Integrated secure authentication and payment processing."
]
},
{
"name": "TaskScape - Kanban Task Management",
"description": "A powerful task management tool, similar to Trello, that allows users to create
organizations, boards, and manage tasks using an intuitive Kanban board system. Built with
modern web technologies, TaskScape ensures smooth collaboration and efficient workflow
management for teams and individuals.",
"technologies": [
"React",
"Node.js",
"Express",
"MongoDB",
"Socket.IO"
],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Created an intuitive Kanban-style task management tool.",
"Implemented real-time collaboration features for team productivity."
]
}
],
"languages": [
"English",
"Hindi",
"Gujarati"
],
"awards": [],
"publications": []
}
like i will this is not obj right?
What you pasted is an object, but in your case it’s just being displayed as pretty-printed JSON text in the
logs.
When you log something like:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 19/27
js
cleanedText is still a string, even though it looks like an object when printed.
How to confirm
If you do:
js
console.log(typeof cleanedText);
you’ll see:
csharp
string
js
then:
js
console.log(typeof parsed);
will show:
csharp
object
Why it matters
JSON.parse() is what turns that pretty-looking JSON string into an actual JavaScript object that Zod
can validate.
Without parsing, Zod will complain because it expects an object, not a string.
If you want, I can show you how to auto-clean, parse, and strip nulls so you always end up with a
proper object ready for Zod validation. That way you won’t run into "null" vs null or string-vs-object
issues again.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 20/27
{
"full_name": "Yash Purani",
"headline": "Full Stack Developer",
"contact_information": {
"email": "contact@yashpurani.com",
"phone": "+91-7600160052",
"address": "Vadodara, Gujarat, India",
"linkedin": "linkedin.com/in/yashpurani",
"website": "yashpurani.com",
"github": "github.com/yash-js"
},
"summary": "Dedicated Full Stack Developer with over 3.5 years of experience designing and
delivering high-performance applications. Proficient in full-stack development, database
management, and test automation. Passionate about creating efficient, scalable solutions and
contributing to team success, with a strong focus on React and Node.js ecosystems.",
"experience": [
{
"job_title": "Software Development Engineer (SDE)",
"company": "Zentosys Solutions PVT.LTD",
"location": "Pune, India",
"start_date": "May 2024",
"end_date": "February 2025",
"description": "Developing and maintaining the on-demand laundry app for the Saudi
Arabian market, ensuring high performance and responsiveness. Optimized backend
processes, reducing server response time by 45%, which significantly improved overall
application performance. Collaborated with cross-functional teams to design, develop, and
deploy new functionalities, driving higher user engagement and satisfaction.",
"achievements": [
"Reduced server response time by 45% through backend process optimization.",
"Contributed to the successful deployment of new features, enhancing user engagement."
],
"technologies_used": ["React", "Node.js", "Express.js", "MongoDB", "AWS", "Docker"]
},
{
"job_title": "Full Stack Developer",
"company": "Proses Web Technologies Pvt Ltd.",
"location": "Vadodara, India",
"start_date": "September 2023",
"end_date": "February 2024",
"description": "Developed high-quality applications using React, React Native, Next.js, and
Node.js. Ensured robustness and responsiveness of applications. Managed database operations
with MySQL and Sequelize.",
"achievements": [
"Delivered robust and responsive applications using modern web technologies.",
"Successfully managed database operations and schema design."
],
"technologies_used": ["React", "React Native", "Next.js", "Node.js", "Express.js", "MySQL",
"Sequelize", "Tailwind CSS"]
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 21/27
},
{
"job_title": "Associate Software Engineer",
"company": "Mahitech LLC",
"location": "Vadodara, India",
"start_date": "July 2021",
"end_date": "August 2023",
"description": "Developed software applications using React, React Native, and Node.js.
Utilized AWS for cloud services. Employed Agile methodology for software development.",
"achievements": [
"Developed and maintained multiple software applications using React and Node.js.",
"Leveraged AWS services for scalable and reliable cloud infrastructure.",
"Actively participated in Agile development cycles, including sprint planning and reviews."
],
"technologies_used": ["React", "React Native", "Node.js", "Express.js", "AWS", "Agile
Methodology", "Git"]
}
],
"education": [
{
"degree": "Bachelor’s in Computer Application",
"institution": "K.J. Institute of Technology",
"location": "Savli, Vadodara, India",
"start_date": "August 2018",
"end_date": "September 2021",
"description": "Completed Bachelor's degree focusing on computer science fundamentals,
programming, and application development."
}
],
"skills": [
"React",
"React Native",
"Next.js",
"Node.js",
"Express.js",
"Sequelize",
"Tailwind CSS",
"Rust",
"MongoDB",
"MySQL",
"IoT",
"Firebase",
"Git",
"JIRA",
"Cypress",
"Material UI",
"HTML Canvas",
"Redis",
"Docker",
"Prisma",
"Redux",
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 22/27
"Strapi",
"Java"
],
"certifications": [],
"projects": [
{
"name": "YellowWallDog",
"description": "An online store where artists can sell their unique creations, including
paintings, digital prints, journals, handmade stickers, greeting cards, and more. Built with the
MERN stack and deployed on an Ubuntu server, the platform offers a seamless shopping
experience for art lovers and a dedicated space for creators to showcase their work.",
"technologies": ["MongoDB", "Express.js", "React", "Node.js", "Ubuntu Server"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Developed a fully functional e-commerce platform for artists.",
"Implemented user authentication and product management features."
]
},
{
"name": "Blog Hive - Multi-Tenant Blogging SaaS",
"description": "A multi-tenant blogging SaaS application built using modern web
technologies. Blog Hive allows users to create and manage their own blogs with unique
subdirectories, secure authentication, and seamless payment integration. The platform is
designed for high performance, scalability, and a smooth user experience.",
"technologies": ["React", "Next.js", "Node.js", "Express.js", "PostgreSQL", "Stripe API",
"Docker"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Engineered a scalable multi-tenant SaaS architecture.",
"Integrated secure user authentication and payment processing."
]
},
{
"name": "TaskScape - Kanban Task Management",
"description": "A powerful task management tool, similar to Trello, that allows users to create
organizations, boards, and manage tasks using an intuitive Kanban board system. Built with
modern web technologies, TaskScape ensures smooth collaboration and efficient workflow
management for teams and individuals.",
"technologies": ["React", "Node.js", "Express.js", "MongoDB", "Socket.IO", "Tailwind CSS"],
"role": "Full Stack Developer",
"link": null,
"achievements": [
"Created an interactive Kanban board for task visualization and management.",
"Implemented real-time collaboration features using WebSockets."
]
}
],
"languages": ["English", "Hindi", "Gujarati"],
"awards": [],
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 23/27
"publications": []
}
make a template to generate new resume pls
Got it — you want a resume generation template that matches your JSON structure so it can be reused
for any new person.
Here’s a clean JSON template with placeholder values that you can feed into your AI or use for manual
filling:
json
{
"full_name": "Full Name",
"headline": "Professional Headline",
"contact_information": {
"email": "email@example.com",
"phone": "+91-XXXXXXXXXX",
"address": "City, State, Country",
"linkedin": "linkedin.com/in/username",
"website": "yourwebsite.com",
"github": "github.com/username"
},
"summary": "A brief professional summary highlighting years of experience, key strengths, and
areas of expertise.",
"experience": [
{
"job_title": "Job Title",
"company": "Company Name",
"location": "City, Country",
"start_date": "Month YYYY",
"end_date": "Month YYYY or Present",
"description": "Describe your role, key responsibilities, and contributions.",
"achievements": [
"Key achievement or accomplishment 1.",
"Key achievement or accomplishment 2."
],
"technologies_used": ["Technology 1", "Technology 2", "Technology 3"]
}
],
"education": [
{
"degree": "Degree Name",
"institution": "Institution Name",
"location": "City, Country",
"start_date": "Month YYYY",
"end_date": "Month YYYY",
"description": "Brief description of the program and achievements."
}
],
"skills": ["Skill 1", "Skill 2", "Skill 3"],
"certifications": [
{
"name": "Certification Name",
"issuer": "Issuer Name",
"date": "Month YYYY",
"description": "Description of the certification."
}
],
"projects": [
{
"name": "Project Name",
"description": "Brief description of the project.",
"technologies": ["Tech 1", "Tech 2", "Tech 3"],
"role": "Role in the project",
"link": "https://project-link.com",
"achievements": [
"Project achievement 1.",
"Project achievement 2."
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 24/27
]
}
],
"languages": ["Language 1", "Language 2"],
"awards": [
{
"title": "Award Title",
"issuer": "Issuer Name",
"date": "Month YYYY",
"description": "Reason or description of the award."
}
],
"publications": [
{
"title": "Publication Title",
"publisher": "Publisher Name",
"date": "Month YYYY",
"link": "https://publication-link.com",
"summary": "Brief summary of the publication."
}
]
}
Matches your current schema — so your Zod validation will work without changes.
All optional fields are still present but can be empty/null if not available.
Uses placeholders to guide what kind of data to insert.
If you want, I can also make you a prompt-ready text version so you can give it directly to OpenAI and
get a filled JSON back that fits your schema perfectly. That way, you can just feed it to JSON.parse and
validate with Zod without manual cleanup.
Do you want me to make that AI-ready prompt version next?
Gotcha — you’re asking for a real generative template, not just placeholders, so that you can plug in a
few personal details (like name, job titles, skills) and it will output a full new resume JSON in the same
format as the one you gave me.
Here’s how I’d structure it so it’s AI-friendly and reusable:
### INPUT:
Full Name: {{full_name}}
Headline: {{headline}}
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 25/27
Contact Email: {{email}}
Phone: {{phone}}
Address: {{address}}
LinkedIn: {{linkedin}}
Website: {{website}}
GitHub: {{github}}
Summary: {{summary}}
Experience: {{experience_details}}
Education: {{education_details}}
Skills: {{skills_list}}
Certifications: {{certifications_list}}
Projects: {{projects_list}}
Languages: {{languages_list}}
Awards: {{awards_list}}
Publications: {{publications_list}}
### SCHEMA:
{
"full_name": "string",
"headline": "string",
"contact_information": {
"email": "string",
"phone": "string",
"address": "string",
"linkedin": "string",
"website": "string",
"github": "string"
},
"summary": "string",
"experience": [
{
"job_title": "string",
"company": "string",
"location": "string",
"start_date": "Month YYYY",
"end_date": "Month YYYY or Present",
"description": "string",
"achievements": ["string", "string"],
"technologies_used": ["string", "string"]
}
],
"education": [
{
"degree": "string",
"institution": "string",
"location": "string",
"start_date": "Month YYYY",
"end_date": "Month YYYY",
"description": "string"
}
],
"skills": ["string", "string"],
"certifications": [
{
"name": "string",
"issuer": "string",
"date": "Month YYYY",
"description": "string"
}
],
"projects": [
{
"name": "string",
"description": "string",
"technologies": ["string", "string"],
"role": "string",
"link": "string or null",
"achievements": ["string", "string"]
}
],
"languages": ["string", "string"],
"awards": [
{
"title": "string",
"issuer": "string",
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 26/27
"date": "Month YYYY",
"description": "string"
}
],
"publications": [
{
"title": "string",
"publisher": "string",
"date": "Month YYYY",
"link": "string",
"summary": "string"
}
]
}
### RULES:
- Maintain exactly the same keys and nesting as the SCHEMA.
- Fill in realistic, professional-sounding details.
- Ensure dates use "Month YYYY" format.
- For empty sections, return empty arrays [].
- Keep technology names consistent with industry standards.
- Ensure all strings are properly escaped for JSON.
- Output ONLY valid JSON with no extra text.
### OUTPUT:
💡 How it works:
1. You replace the {{placeholders}} in the INPUT section with basic facts about the person.
2. You paste this whole thing into GPT (or any LLM) and it will output a brand new complete resume
JSON.
3. It will follow your schema exactly so your Zod parser can validate it without breaking.
If you want, I can now adapt this template so that it automatically reuses your own Yash Purani resume
wording as a style reference for generating other resumes. That way every generated resume has the
same tone, structure, and detail richness as yours.
Do you want me to make that style-adapted version next?
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 27/27