Skip to content

Commit cdc71c1

Browse files
committed
chore: use new interface for generating bundle
1 parent 50e123c commit cdc71c1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub use oca_ast::ast::{
1414
RefValue,
1515
};
1616

17+
use oca_bundle::state::oca_bundle::OCABundle;
1718
pub use oca_bundle::state::oca_bundle::OCABundleModel;
1819
/// Performs semantic validation of an `OCABundle` and returns a status
1920
/// indicating whether the validation succeeded or failed, along with any associated errors.
@@ -83,7 +84,8 @@ pub trait ToJSON {
8384

8485
impl ToJSON for OCABundleModel {
8586
fn get_json_bundle(&self) -> String {
86-
let result = self.to_json();
87+
let oca_bundle = OCABundle::from(self.clone());
88+
let result = serde_json::to_string_pretty(&oca_bundle);
8789
match result {
8890
Ok(json) => json,
8991
Err(e) => format!("Error converting to JSON: {}", e),

0 commit comments

Comments
 (0)