Skip to main content

TransformConfig

Struct TransformConfig 

Source
pub struct TransformConfig {
    pub upgrade_to_3_1: bool,
    pub annotate_sse: bool,
    pub inject_validation: bool,
    pub add_security: bool,
    pub inline_request_bodies: bool,
    pub flatten_uuid_refs: bool,
    pub normalize_line_endings: bool,
    pub inject_servers: bool,
    pub rewrite_create_responses: bool,
    pub annotate_field_access: bool,
}
Expand description

Individual transform on/off switches (all default to true).

Controls which phases of the 12-phase pipeline run. Each toggle maps to one or more pipeline phases. See patch() for phase ordering.

Fields§

§upgrade_to_3_1: bool

Upgrade OpenAPI 3.0 → 3.1 (phase 1).

Converts openapi: "3.0.x" to "3.1.0", rewrites nullable: true to type: ["string", "null"], and applies other 3.1 structural changes.

§annotate_sse: bool

Annotate SSE streaming operations (phase 2).

Adds text/event-stream response content type, Last-Event-ID header, and streaming-specific descriptions to server-streaming RPCs.

§inject_validation: bool

Inject proto validation constraints into JSON Schema (phase 9).

Maps validate.rules from proto field options to minLength, maxLength, pattern, minimum, maximum, required, and enum constraints.

§add_security: bool

Add bearer auth security schemes (phase 6).

Injects a bearerAuth security scheme and applies it globally, with overrides for public endpoints.

§inline_request_bodies: bool

Inline request body schemas for better Swagger UI rendering (phase 11).

Replaces $ref request bodies with inline schemas containing property examples, improving the “Try it out” experience in Swagger UI.

§flatten_uuid_refs: bool

Flatten UUID wrapper $ref to inline type: string, format: uuid (phase 8).

Simplifies single-field UUID wrapper messages by inlining the string type with format: uuid and pattern validation.

§normalize_line_endings: bool

Normalize CRLF → LF in string values (phase 12).

Ensures consistent line endings in the output spec, preventing platform-dependent diffs.

§inject_servers: bool

Inject servers and info overrides into the spec (phase 1).

Merges configured server URLs and info block overrides (contact, license, terms of service) into the spec.

§rewrite_create_responses: bool

Rewrite 200201 Created for create/signup endpoints (phase 3).

Detects operations named Create*, SignUp*, or Register* and changes their success response from 200 to 201.

§annotate_field_access: bool

Annotate fields with writeOnly/readOnly based on naming conventions (phase 9).

Fields matching patterns like password, secret, token are marked writeOnly. Fields like created_at, updated_at are marked readOnly. Additional patterns can be configured via write_only_fields / read_only_fields.

Trait Implementations§

Source§

impl Clone for TransformConfig

Source§

fn clone(&self) -> TransformConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TransformConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for TransformConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TransformConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Copy for TransformConfig

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<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, 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,