Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: validate bookmark files #42

Merged
merged 1 commit into from
Feb 11, 2024
Merged

Conversation

frederikb
Copy link
Owner

@frederikb frederikb commented Feb 11, 2024

The JSON structure supported by this extension was never explictly documented and only explained by examples. Due to upcoming features and knowing how manipulating (deeply) nested JSON by hand is error-prone it makes sense to perform validation before attempting to import the bookmark files.

I defined a JSON schema and additionally published it to a public location. JSON Schema for Bookmarks:
https://frederikb.github.io/bookmarksync/schemas/bookmarks.1-0-0.schema.json In the (rare) case that the schema is updated we need to ensure that the new version is published as well.
The schema is versioned according to SchemaVer.

As a side benefit, users may also reference the schema in their bookmark JSON files, via a $schema entry on the root and gain immediate validation in their editor (if supported).

Fixes #29

@frederikb frederikb self-assigned this Feb 11, 2024
@frederikb frederikb added the enhancement New feature or request label Feb 11, 2024
@frederikb frederikb force-pushed the feature/bookmark-file-validation branch 2 times, most recently from 0c1fb0d to 0e9dd78 Compare February 11, 2024 16:22
The JSON structure supported by this extension was never explictly documented
and only explained by examples. Due to upcoming features and knowing how manipulating
(deeply) nested JSON by hand is error-prone it makes sense to perform validation
before attempting to import the bookmark files.

I defined a JSON schema and additionally published it to a public location.
JSON Schema for Bookmarks:
https://frederikb.github.io/bookmarksync/schemas/bookmarks.1-0-0.schema.json
In the (rare) case that the schema is updated we need to ensure that the new version is published
as well.
The schema is versioned according to SchemaVer.

As a side benefit, users may also reference the schema in their bookmark JSON files,
via a $schema entry on the root and gain immediate validation in their editor (if supported).

Fixes #29
@frederikb frederikb force-pushed the feature/bookmark-file-validation branch from 0e9dd78 to f5c1e56 Compare February 11, 2024 17:17
@frederikb frederikb merged commit 1123cc8 into main Feb 11, 2024
3 checks passed
@frederikb frederikb deleted the feature/bookmark-file-validation branch February 11, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Validation Feature to Abort Synchronization on Format Mismatch
1 participant