-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implment connections json schema (#2069)
* chore: create json schema from connection types * chore: remove redudant code * chore: fix tests * chore: fix grpc tests
- Loading branch information
Showing
25 changed files
with
3,181 additions
and
542 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
let schema_path = Path::new("../json_schemas"); | ||
// Define the path to the file we want to create or overwrite | ||
let connection_path = schema_path.join("connections.json"); | ||
let dozer_path = schema_path.join("dozer.json"); | ||
|
||
let mut file = File::create(connection_path).expect("Failed to create connections.json"); | ||
let schemas = dozer_types::models::get_connection_schemas().unwrap(); | ||
write!(file, "{}", schemas).expect("Unable to write file"); | ||
|
||
let mut dozer_schema_file = File::create(dozer_path).expect("Failed to create dozer.json"); | ||
let schema = dozer_types::models::get_dozer_schema().unwrap(); | ||
write!(dozer_schema_file, "{}", schema).expect("Unable to write file"); | ||
|
||
// Print a message to indicate the file has been written | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
println!("Written to {:?}", schema_path.display()); | ||
} |
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
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.