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: boolUpgrade 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: boolAnnotate 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: boolInject 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: boolAdd bearer auth security schemes (phase 6).
Injects a bearerAuth security scheme and applies it globally,
with overrides for public endpoints.
inline_request_bodies: boolInline 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: boolFlatten 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: boolNormalize CRLF → LF in string values (phase 12).
Ensures consistent line endings in the output spec, preventing platform-dependent diffs.
inject_servers: boolInject 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: boolRewrite 200 → 201 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: boolAnnotate 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
impl Clone for TransformConfig
Source§fn clone(&self) -> TransformConfig
fn clone(&self) -> TransformConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more