pub struct SchemaGenerator { /* private fields */ }Expand description
Main JSON Schema generator for DDEX models
Implementations§
Source§impl SchemaGenerator
 
impl SchemaGenerator
Sourcepub fn generate_openapi_spec(
    &self,
    schema: &JsonSchema,
) -> Result<String, BuildError>
 
pub fn generate_openapi_spec( &self, schema: &JsonSchema, ) -> Result<String, BuildError>
Generate OpenAPI specification from schema
Source§impl SchemaGenerator
 
impl SchemaGenerator
Sourcepub fn new(version: DdexVersion, profile: MessageProfile) -> Self
 
pub fn new(version: DdexVersion, profile: MessageProfile) -> Self
Create a new schema generator
Sourcepub fn with_preset(
    version: DdexVersion,
    profile: MessageProfile,
    preset: PartnerPreset,
) -> Self
 
pub fn with_preset( version: DdexVersion, profile: MessageProfile, preset: PartnerPreset, ) -> Self
Create schema generator with preset
Sourcepub fn with_config(self, config: SchemaConfig) -> Self
 
pub fn with_config(self, config: SchemaConfig) -> Self
Set schema configuration
Sourcepub fn generate_build_request_schema(
    &self,
) -> Result<SchemaGenerationResult, BuildError>
 
pub fn generate_build_request_schema( &self, ) -> Result<SchemaGenerationResult, BuildError>
Generate complete JSON Schema for DDEX BuildRequest
Sourcepub fn generate_flat_release_schema(
    &self,
) -> Result<SchemaGenerationResult, BuildError>
 
pub fn generate_flat_release_schema( &self, ) -> Result<SchemaGenerationResult, BuildError>
Generate schema for FlatRelease model
Sourcepub fn generate_complete_schema(
    &self,
) -> Result<SchemaGenerationResult, BuildError>
 
pub fn generate_complete_schema( &self, ) -> Result<SchemaGenerationResult, BuildError>
Generate schema for all DDEX element types
Sourcepub fn generate_typescript_types(
    &self,
    schema: &JsonSchema,
) -> Result<String, BuildError>
 
pub fn generate_typescript_types( &self, schema: &JsonSchema, ) -> Result<String, BuildError>
Generate TypeScript type definitions from schema
Sourcepub fn generate_python_types(
    &self,
    schema: &JsonSchema,
) -> Result<String, BuildError>
 
pub fn generate_python_types( &self, schema: &JsonSchema, ) -> Result<String, BuildError>
Generate Python TypedDict definitions from schema
Trait Implementations§
Source§impl Clone for SchemaGenerator
 
impl Clone for SchemaGenerator
Source§fn clone(&self) -> SchemaGenerator
 
fn clone(&self) -> SchemaGenerator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreAuto Trait Implementations§
impl Freeze for SchemaGenerator
impl RefUnwindSafe for SchemaGenerator
impl Send for SchemaGenerator
impl Sync for SchemaGenerator
impl Unpin for SchemaGenerator
impl UnwindSafe for SchemaGenerator
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more