pub struct JSONSchemaImporter;Expand description
Parser for JSON Schema format.
Implementations§
Source§impl JSONSchemaImporter
impl JSONSchemaImporter
Sourcepub fn new() -> JSONSchemaImporter
pub fn new() -> JSONSchemaImporter
Create a new JSON Schema parser instance.
§Example
use data_modelling_core::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_core::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§
Source§impl Default for JSONSchemaImporter
impl Default for JSONSchemaImporter
Source§fn default() -> JSONSchemaImporter
fn default() -> JSONSchemaImporter
Returns the “default value” for a type. Read more
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