validation_context
¶
ValidationContext
¶
get_current_date(info)
¶
Extract current date from validation context or default to today.
Why
Date calculations (like months of experience) must use consistent
reference dates. Users can override via settings.current_date for
reproducible builds, otherwise defaults to today. The "today"
keyword is resolved to the actual current date.
Parameters:
-
info(ValidationInfo) –Pydantic validation info containing context.
Returns:
-
date–Current date from context or Date.today().
Source code in src/rendercv/schema/models/validation_context.py
get_input_file_path(info)
¶
Extract input file path from validation context.
Why
Relative paths in YAML (like photo references) must resolve relative to the input file's directory. Validators access this path via context to compute absolute paths during validation.
Parameters:
-
info(ValidationInfo) –Pydantic validation info containing context.
Returns:
-
Path | None–Input file path if available, otherwise None.