Skip to main content

SchemaAnalysis

Struct SchemaAnalysis 

Source
pub struct SchemaAnalysis {
    pub schemas: BTreeMap<String, AnalyzedSchema>,
    pub dependencies: DependencyGraph,
    pub patterns: DetectedPatterns,
    pub operations: BTreeMap<String, OperationInfo>,
    pub operation_responses: BTreeMap<String, BTreeMap<String, OperationResponse>>,
    pub operation_id_aliases: BTreeMap<String, Vec<String>>,
    pub used_type_features: UsedFeatures,
    pub enum_extensions: BTreeMap<String, EnumExtensions>,
    pub validation_context: ValidationContext,
    pub untagged_union_branches: BTreeSet<String>,
}

Fields§

§schemas: BTreeMap<String, AnalyzedSchema>

All schemas indexed by name

§dependencies: DependencyGraph

Dependency graph for generation ordering

§patterns: DetectedPatterns

Detected patterns and transformations

§operations: BTreeMap<String, OperationInfo>

OpenAPI operations and their request/response schemas

§operation_responses: BTreeMap<String, BTreeMap<String, OperationResponse>>

Complete response contracts by emitted operation ID and response key. Unlike OperationInfo::response_schemas, this retains responses with no body as well as their selected JSON media type and SSE declaration.

§operation_id_aliases: BTreeMap<String, Vec<String>>

Source operationId to emitted operation IDs. Duplicate or Rust-identifier-colliding IDs are renamed during analysis; retaining this mapping lets selector resolution report ambiguity or renaming.

§used_type_features: UsedFeatures

Optional crates the TypeMapper was asked to reference during analysis (e.g. chrono when a format: date-time field became chrono::DateTime<Utc>). The generator reads this to decide which helper modules (e.g. base64_serde) to emit. Complete dependency reporting is collected from retained emitted files so pruned schemas cannot leak stale requirements.

§enum_extensions: BTreeMap<String, EnumExtensions>

Q2.6: per-schema vendor enum extensions (x-enum-varnames / x-enum-descriptions). Populated during analysis when a StringEnum / ExtensibleEnum schema declares either extension; the generator uses these to override the default heuristic variant names and emit per-variant doc comments. Indexed by analyzed-schema name. Side-channel so we don’t have to touch every StringEnum constructor.

§validation_context: ValidationContext

Raw, unpruned schema material used to build offline server validators. This is deliberately independent of schemas, which model pruning may mutate before server artifacts are emitted.

§untagged_union_branches: BTreeSet<String>

Schemas reachable as a branch of an untagged union.

#[serde(untagged)] tries branches in order and takes the first that deserializes, so a branch that accepts more than its schema allows claims values belonging to a later branch. A struct in this set whose document states additionalProperties: false must therefore reject undeclared keys; elsewhere leniency costs nothing and keeps generated clients working when a server adds a field.

Populated at the end of SchemaAnalyzer::analyze, after inline branch schemas exist. Side-channel keyed by analyzed-schema name so no object constructor has to carry it.

Implementations§

Source§

impl SchemaAnalysis

Source

pub fn untyped_fields(&self) -> Vec<UntypedFinding>

Every generated field that carries serde_json::Value, with the reason.

Derived from the analyzed types rather than recorded as analysis runs, so the count tracks generated output: a schema referenced by fifty properties contributes fifty findings, and a pruned one contributes none.

Trait Implementations§

Source§

impl Clone for SchemaAnalysis

Source§

fn clone(&self) -> SchemaAnalysis

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SchemaAnalysis

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more