-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jack Leightcap <[email protected]>
- Loading branch information
1 parent
b207da1
commit e8f2d78
Showing
36 changed files
with
38 additions
and
22 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,14 +1,27 @@ | ||
use schemafy_core; | ||
use serde; | ||
use serde_json; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
pub mod sigstore { | ||
pub mod verification { | ||
pub mod v1 { | ||
use super::super::super::*; | ||
schemafy::schemafy!("schema/Artifact.schema.json"); | ||
} | ||
} | ||
} | ||
/// NOTE(jleightcap): a method to include all JSON schemas is not immediately obvious to me: | ||
/// | ||
/// - `schemafy!` is a direct 1:1 compilation to Rust structures of each definition in "defintions", | ||
/// - each schema is 'standalone': including definitions of all it's dependencies, | ||
/// as a result, the Rust generated structures have name collisions if included in the same module scope. | ||
/// | ||
/// prefixing works, | ||
/// | ||
/// ```rust | ||
/// mod CertificateIdentity { | ||
/// schemafy::schemafy!("schemas/CertificateIdentity.shema.json") | ||
/// } | ||
/// mod CertificateIdentities { | ||
/// schemafy::schemafy!("schemas/CertificateIdentities.schema.json") | ||
/// } | ||
/// ``` | ||
/// but is clunky to use and manual to generate. | ||
/// | ||
/// a more general approach is to 'flatten' each JSON Schema, | ||
/// unioning all of the "defintions" fields. | ||
/// | ||
/// Since standardized bundles is the singular motiviation for these Rust bindings, | ||
/// for now we're punting this issue. | ||
|
||
schemafy::schemafy!("schemas/Bundle.schema.json"); |