-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add command to generate JSON schema for the package
There's a fundamental issue: the app works off of pydantic models. They are the source of truth. We'd like to provide an ancv-specific JSON Schema for users to fill out their JSONs against/with. IDEs like VSCode would then help with auto-completion. Nice win! Ideally, we'd like to auto-generate the JSON Schema from the pydantic models. This has the downside of suddenly including a verbose version of the (licensed) JSON Resume schema instead of just referencing it via URL. It also leads to inconsistencies. We could also hand-write a JSON Schema and auto-generate the Pydantic models from it (the inverse way). This has countless more problems, like the weird ISO-8601 regex-based definition in the JSON Resume Schema, which we had changed to `date` types in the pydantic models. As such, it was deemed most suitable to hand-write *both* the JSON Schema for ancv as well as the pydantic models. This leads to (some minor) code duplication and the risk of the two becoming asynchronous. If this proves a pain in the future, look into this issue again. For now, the pain of keeping the two in sync is much greater.
- Loading branch information
Showing
3 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"allOf": [ | ||
{ | ||
"$ref": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json" | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"meta": { | ||
"allOf": [ | ||
{ | ||
"$ref": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json#/properties/meta" | ||
} | ||
], | ||
"properties": { | ||
"ancv": { | ||
"type": "object", | ||
"description": "ancv-specific (https://ancv.io) properties", | ||
"properties": { | ||
"template": { | ||
"type": "string", | ||
"description": "The template (ordering, alignment, positioning, ...) to use", | ||
"enum": [ | ||
"Sequential" | ||
] | ||
}, | ||
"theme": { | ||
"type": "string", | ||
"description": "The theme (colors, emphasis, ...) to use", | ||
"enum": [ | ||
"basic", | ||
"grayscale", | ||
"hendrix", | ||
"lollipop", | ||
"plain" | ||
] | ||
}, | ||
"language": { | ||
"type": "string", | ||
"description": "The language aka translation (for section titles like 'Education' etc.) to use", | ||
"enum": [ | ||
"de", | ||
"en", | ||
"es", | ||
"fr" | ||
] | ||
}, | ||
"ascii_only": { | ||
"type": "boolean", | ||
"description": "Whether to only use ASCII characters in the template (you are responsible for not using non-ASCII characters in your resume)" | ||
}, | ||
"dec31_as_year": { | ||
"type": "boolean", | ||
"description": "Whether to display dates of 'December 31st of some year' as that year only, without month or day info" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters