-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do some housekeeping in preparation for release
* Increment version to v0.2.0. * Flesh out the Changelog. * Switch to the `theory/changelog-version-notes-action` to generate release notes. * Make the `meta` module public. * Make the `valid` module public and remove its importation from the crate root. * Move the validation example to the `valid` module. * Make the `try_from(meta: &[&Value])` documentation visible and start thinking through documentation for the `meta` module.
- Loading branch information
Showing
10 changed files
with
102 additions
and
229 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -3,48 +3,17 @@ | |
/*! | ||
PGXN Metadata validation. | ||
This crate uses JSON Schema to validate PGXN Meta Spec `META.json` files. | ||
It supports both the [v1] and [v2] specs. | ||
# Example | ||
``` rust | ||
use std::{path::PathBuf, error::Error}; | ||
use serde_json::json; | ||
use pgxn_meta::*; | ||
let meta = json!({ | ||
"name": "pair", | ||
"abstract": "A key/value pair data type", | ||
"version": "0.1.8", | ||
"maintainers": [{ "name": "theory", "email": "[email protected]" }], | ||
"license": "PostgreSQL", | ||
"contents": { | ||
"extensions": { | ||
"pair": { | ||
"sql": "sql/pair.sql", | ||
"control": "pair.control" | ||
} | ||
} | ||
}, | ||
"meta-spec": { "version": "2.0.0" } | ||
}); | ||
let mut validator = Validator::new(); | ||
assert!(validator.validate(&meta).is_ok()); | ||
# Ok::<(), Box<dyn Error>>(()) | ||
``` | ||
This crate uses JSON Schema to validate and inspect the PGXN `META.json` | ||
files. It supports both the [v1] and [v2] specs. | ||
[v1]: https://rfcs.pgxn.org/0001-meta-spec-v1.html | ||
[v2]: https://rfcs.pgxn.org/0003-meta-spec-v2.html | ||
[v2]: https://github.com/pgxn/rfcs/pull/3 | ||
*/ | ||
|
||
mod util; | ||
mod valid; | ||
pub use valid::{ValidationError, Validator}; | ||
mod meta; | ||
// pub use meta::*; | ||
pub mod meta; | ||
mod util; // private utilities | ||
pub mod valid; | ||
|
||
#[cfg(test)] | ||
mod tests; |
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
Oops, something went wrong.