pub struct JSONSchemaImporter;Expand description
Parser for JSON Schema format.
Implementations§
Source§impl JSONSchemaImporter
impl JSONSchemaImporter
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new JSON Schema parser instance.
§Example
use data_modelling_sdk::import::json_schema::JSONSchemaImporter;
let importer = JSONSchemaImporter::new();Sourcepub fn import(&self, json_content: &str) -> Result<ImportResult, ImportError>
pub fn import(&self, json_content: &str) -> Result<ImportResult, ImportError>
Import JSON Schema content and create Table(s) (SDK interface).
§Arguments
json_content- JSON Schema string (can be a single schema or schema with definitions)
§Returns
An ImportResult containing extracted tables and any parse errors.
§Example
use data_modelling_sdk::import::json_schema::JSONSchemaImporter;
let importer = JSONSchemaImporter::new();
let schema = r#"
{
"type": "object",
"properties": {
"id": {"type": "integer"},
"name": {"type": "string"}
},
"required": ["id"]
}
"#;
let result = importer.import(schema).unwrap();Trait Implementations§
Auto Trait Implementations§
impl Freeze for JSONSchemaImporter
impl RefUnwindSafe for JSONSchemaImporter
impl Send for JSONSchemaImporter
impl Sync for JSONSchemaImporter
impl Unpin for JSONSchemaImporter
impl UnwindSafe for JSONSchemaImporter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more