YAMLResume

Zod Schema

YAMLResume adopts zod to validate resume data in runtime.

This document outlines all zod schema used in YAMLResume. If you are interested in the implementation details, you can find the source code here.

Resume Schema

Defines the overall resume structure validation, including content and layout validation.

PropTypeRequired
contentContentSchema
layouts?LayoutsSchema
locale?LocaleSchema

ContentSchema

Defines the validation structure for the entire resume content.

PropTypeRequired
basicsBasicsItemSchema
educationEducationItemSchema[]
awards?AwardItemSchema[]
certificates?CertificateItemSchema[]
interests?InterestItemSchema[]
languages?LanguageItemSchema[]
location?LocationItemSchema
projects?ProjectItemSchema[]
profiles?ProfileItemSchema[]
publications?PublicationItemSchema[]
references?ReferenceItemSchema[]
skills?SkillItemSchema[]
volunteer?VolunteerItemSchema[]
work?WorkItemSchema[]

AwardItemSchema

Validates a single award, honor, or recognition received.

PropTypeRequiredValidation Rules
awarderstring2-128 characters
titlestring2-128 characters
date?stringsee date schema
summary?stringsee summary schema

BasicsItemSchema

Validates the core personal and contact information.

PropTypeRequiredValidation Rules
namestring2-128 characters
email?stringsee email schema
headline?string2-128 characters
phone?stringsee phone schema
summary?stringsee summary schema
url?stringsee url schema

CertificateItemSchema

Validates a single certification, credential, or professional qualification.

PropTypeRequiredValidation Rules
issuerstring2-128 characters
namestring2-128 characters
date?stringsee date schema
url?stringsee url schema

EducationItemSchema

Validates a single educational experience or degree program.

PropTypeRequiredValidation Rules
areastring2-64 characters
degreeDegreeMust be from predefined degree options
institutionstring2-128 characters
startDatestringsee date schema
courses?string[]Each item 2-128 characters
endDate?stringsee date schema
summary?stringsee summary schema
score?string2-32 characters
url?stringsee url schema

InterestItemSchema

Validates a single interest, hobby, or personal activity.

PropTypeRequiredValidation Rules
namestring2-128 characters
keywords?string[]see keywords schema

LanguageItemSchema

Validates a single language proficiency item.

PropTypeRequiredValidation Rules
fluencyFluencyMust be from predefined fluency options
languageLanguageMust be from predefined language options
keywords?string[]Each item 1-32 characters

LocationItemSchema

Validates location and address information.

PropTypeRequiredValidation Rules
citystring2-128 characters
address?string2-128 characters
country?CountryMust be from predefined country options
postalCode?string2-128 characters
region?string2-128 characters

ProfileItemSchema

Validates a single online profile or social media presence.

PropTypeRequiredValidation Rules
networkNetworkMust be from predefined network options
usernamestring2-128 characters
url?stringValid URL, max 256 chars

ProjectItemSchema

Validates a single project, portfolio piece, or technical work.

PropTypeRequiredValidation Rules
namestring2-128 characters
startDatestringsee date schema
summarystringsee summary schema
description?string4-128 characters
endDate?stringsee date schema
keywords?string[]Each item 1-32 characters
url?stringValid URL, max 256 chars

PublicationItemSchema

Validates a single publication, research work, or academic paper.

PropTypeRequiredValidation Rules
namestring2-128 characters
publisherstring2-128 characters
releaseDate?stringsee date schema
summary?stringsee summary schema
url?stringValid URL, max 256 chars

ReferenceItemSchema

Validates a single professional reference or recommendation.

PropTypeRequiredValidation Rules
namestring2-128 characters
summarystringsee summary schema
email?stringsee email schema
phone?stringValid phone format
relationship?string2-128 characters

SkillItemSchema

Validates a single skill, competency, or technical ability.

PropTypeRequiredValidation Rules
levelLevelMust be from predefined level options
namestring2-128 characters
keywords?string[]Each item 1-32 characters

VolunteerItemSchema

Validates a single volunteer experience or community service.

PropTypeRequiredValidation Rules
organizationstring2-128 characters
positionstring2-128 characters
startDatestringsee date schema
summarystringsee summary schema
endDate?stringsee date schema
url?stringValid URL, max 256 chars

WorkItemSchema

Validates a single work experience or employment position.

PropTypeRequiredValidation Rules
namestring2-128 characters
positionstring2-128 characters
startDatestringsee date schema
summarystringsee summary schema
endDate?stringsee date schema
keywords?string[]Each item 1-32 characters
url?stringValid URL, max 256 chars

LocaleSchema

Validates locale settings for internationalization and localization.

PropTypeRequiredValidation Rules
language?LocaleLanguageMust be from predefined locale language options

LayoutsSchema

Defines the overall layout validation configuration.

PropTypeRequiredValidation Rules
layouts[]LatexLayoutSchema | MarkdownLayoutSchemaArray of layout configurations.

Common Layout Schemas

MarginsSchema

Validates page margin settings for document layout.

PropTypeRequiredValidation Rules
top?stringsee margin size schema
bottom?stringsee margin size schema
left?stringsee margin size schema
right?stringsee margin size schema
SectionsSchema

Validates section customization settings.

PropTypeRequiredValidation Rules
aliases?Record<SectionID, string>Keys must be valid section IDs, values must be strings (2-128 chars)
order?OrderableSectionID[]Array of valid orderable section IDs

LatexLayoutSchema

Validates LaTeX layout configuration.

PropTypeRequiredValidation Rules
advanced?LatexAdvancedSchemaSee advanced schema
engine'latex'Must be "latex"
page?LatexPageSchemaSee page schema
sections?SectionsSchemaSee sections schema
template?LatexTemplateMust be from predefined template options
typography?LatexTypographySchemaSee typography schema
LatexAdvancedSchema

Validates advanced LaTeX configuration options.

PropTypeRequiredValidation Rules
fontspec?{ numbers?: LatexFontspecNumbers }Must be from predefined fontspec numbers options
LatexPageSchema

Validates page-level settings for document presentation.

PropTypeRequiredValidation Rules
margins?MarginsSchemaSee margins schema
showPageNumbers?booleantrue/false
LatexTypographySchema

Validates typography settings for document formatting.

PropTypeRequiredValidation Rules
fontSize?stringMust be from predefined font size options
links?{ underline?: boolean }true/false

MarkdownLayoutSchema

Validates Markdown layout configuration.

PropTypeRequiredValidation Rules
engine'markdown'Must be "markdown"
sections?SectionsSchemaSee sections schema

Primitive Validation Schemas

Email Schema

Validates email addresses with strict format requirements.

Validation Rules:

  • Must be a valid email format
  • Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$
  • Examples: hi@ppresume.com, first.last@company.org, test+tag@domain.co.uk

Phone Schema

Validates phone numbers with flexible format support.

Validation Rules:

  • Pattern: ^[+]?[(]?[0-9\\s-]{1,15}[)]?[0-9\\s-]{1,15}$
  • May include country code, parentheses, spaces, and hyphens
  • Examples: 555-123-4567, +44 20 7946 0958, (555) 123-4567

Summary Schema

Validates summary text with length constraints.

Validation Rules:

  • Must be between 16 and 1024 characters
  • Examples:
    • "Experienced software engineer with 5+ years in full-stack development."
    • "Creative designer passionate about user experience and modern design principles."
    • "Dedicated project manager with proven track record of delivering complex projects on time and budget."

URL Schema

Validates URLs with length constraints.

Validation Rules:

  • Must be a valid URL format
  • Maximum length of 256 characters
  • Examples: https://yamlresume.dev, https://ppresume.com, https://github.com/yamlresume/yamlresume

Keywords Schema

Validates keyword arrays with individual item constraints.

Validation Rules:

  • Array of strings
  • Each keyword must be between 1 and 32 characters
  • Examples: ["Javascript", "React", "Typescript"], ["Design", "UI", "UX"]

Date Schema

Validates date strings with format requirements.

Validation Rules:

  • Must be between 4 and 32 characters
  • Must be parseable by Date.parse()
  • Examples: 2025-01-01, Jul 2025, July 3, 2025, 2025-02-02T00:00:03.123Z

Margin Size Schema

Validates margin size strings with unit requirements.

Validation Rules:

  • Must be between 2 and 32 characters
  • Pattern: ^\\d+(\\.\\d+)?(cm|pt|in)$
  • Must be a positive number followed by valid units: cm, pt, or in
  • Examples: 2.5cm, 1in, 72pt, 0.5cm, 12pt

Enum Validation Schemas

Country

A union type for all possible countries and regions in the world.

Validation Rules:

  • Must be one of the predefined country options
  • Examples: United States, China, United Kingdom, Germany

Degree

A union type for all possible degrees.

Validation Rules:

  • Must be one of: Associate, Bachelor, Diploma, Doctor, High School, Master, Middle School

Fluency

A union type for all possible language fluency levels.

Validation Rules:

  • Must be one of:
    • Elementary Proficiency
    • Full Professional Proficiency
    • Limited Working Proficiency
    • Minimum Professional Proficiency
    • Native or Bilingual Proficiency

Language

A union type for all supported languages.

Validation Rules:

  • Must be one of the predefined language options
  • Examples: English, Chinese, Spanish, French, German

Level

A union type for all possible skill proficiency levels.

Validation Rules:

  • Must be one of: Advanced, Beginner, Expert, Intermediate, Master, Novice

Network

A union type for all possible social network options.

Validation Rules:

  • Must be one of the predefined network options
  • Examples: GitHub, LinkedIn, Twitter, Facebook, Instagram

LatexTemplate

A union type for all possible template options.

Validation Rules:

  • Must be one of: moderncv-banking, moderncv-casual, moderncv-classic
  • See also: templates

LocaleLanguage

A union type for all possible locale languages.

Validation Rules:

  • Must be one of: en, es, zh-hans, zh-hant-hk, zh-hant-tw
  • See also: multi-languages

LatexFontspecNumbers

A union type for all possible latex fontspec numbers options.

Validation Rules:

  • Must be one of:
    • Auto - allowing the style to be automatically determined based on the selected LocaleLanguage (default)
    • Lining - standard lining figures (default for CJK languages)
    • OldStyle - old style figures with varying heights (default for Latin languages)

LatexFontSize

A union type for all possible latex font size options.

Validation Rules:

  • Must be one of: 10pt, 11pt, 12pt
  • 10pt is the default font size
Edit on GitHub

Last updated on