Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jssblck committed May 15, 2024
1 parent e90f449 commit f558858
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pretty_assertions = "1.4.0"
regex = "1.6.0"
schemars = "0.8.19"
serde = { version = "1.0.140", features = ["derive"] }
serde_json = "1.0.95"
strum = { version = "0.24.1", features = ["derive"] }
thiserror = "1.0.31"
typed-builder = "0.10.0"
Expand All @@ -21,4 +22,3 @@ typed-builder = "0.10.0"
assert_matches = "1.5.0"
itertools = "0.10.5"
proptest = "1.0.0"
serde_json = "1.0.95"
2 changes: 2 additions & 0 deletions src/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use schemars::{
JsonSchema,
};
use serde::{Deserialize, Serialize};
use serde_json::json;
use typed_builder::TypedBuilder;

use crate::{parse_org_project, Error, Fetcher, PackageLocator, ParseError, StrictLocator};
Expand Down Expand Up @@ -286,6 +287,7 @@ impl JsonSchema for Locator {
"}
.to_string(),
),
examples: vec![json!("git+github.com/fossas/example$1234")],
..Default::default()
})),
..Default::default()
Expand Down
2 changes: 2 additions & 0 deletions src/locator_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use schemars::{
JsonSchema,
};
use serde::{Deserialize, Serialize};
use serde_json::json;
use typed_builder::TypedBuilder;

use crate::{Error, Fetcher, Locator, StrictLocator};
Expand Down Expand Up @@ -161,6 +162,7 @@ impl JsonSchema for PackageLocator {
"}
.to_string(),
),
examples: vec![json!("git+github.com/fossas/example")],
..Default::default()
})),
..Default::default()
Expand Down
2 changes: 2 additions & 0 deletions src/locator_strict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use schemars::{
JsonSchema,
};
use serde::{Deserialize, Serialize};
use serde_json::json;
use typed_builder::TypedBuilder;

use crate::{Error, Fetcher, Locator, PackageLocator, ParseError};
Expand Down Expand Up @@ -186,6 +187,7 @@ impl JsonSchema for StrictLocator {
"}
.to_string(),
),
examples: vec![json!("git+github.com/fossas/example$1234")],
..Default::default()
})),
..Default::default()
Expand Down

0 comments on commit f558858

Please sign in to comment.