Skip to main content

OutputOptions

Struct OutputOptions 

Source
pub struct OutputOptions {
    pub skip_prune: bool,
    pub include_tags: Vec<String>,
    pub exclude_tags: Vec<String>,
    pub include_operation_ids: Vec<String>,
    pub exclude_operation_ids: Vec<String>,
    pub exclude_schemas: Vec<String>,
    pub response_type_suffix: Option<String>,
    pub type_name_suffix: Option<String>,
}
Expand description

Output tuning options.

Fields§

§skip_prune: bool

Keep schemas that are not referenced (no pruning).

§include_tags: Vec<String>

Only generate operations tagged with one of these tags (empty = all).

§exclude_tags: Vec<String>

Skip operations tagged with any of these tags.

§include_operation_ids: Vec<String>

Only generate operations whose operationId is one of these (empty = all).

§exclude_operation_ids: Vec<String>

Skip operations whose operationId is one of these.

§exclude_schemas: Vec<String>

Remove these component schemas from the spec before lowering, so their models are not generated. Filtering runs before pruning. If an excluded schema is still referenced by a retained operation or schema, generation can fail or emit a reference to a type that is not declared.

§response_type_suffix: Option<String>

Suffix appended to a per-operation response enum’s name (default Response). Set this to resolve a clash between a generated <Op>Response enum and a component schema of the same name, mirroring oapi-codegen’s response-type-suffix.

§type_name_suffix: Option<String>

Suffix added to the second of two schema names that collapse onto one Rust identifier. For example, foo-bar and fooBar both become FooBar.

The default is unset. An unset suffix makes such a collision an error, because the generator will not pick a name for one of two distinct schemas. Use x-rust-name on the colliding schema first. That extension marks one schema and records the name the author wants. This option is for specs with many mechanical collisions, where one annotation per schema costs too much.

A set suffix must hold at least one letter or digit. Casing removes punctuation, so a suffix such as - leaves the type name unchanged and cannot resolve a collision. See crate::lower::type_renames.

Trait Implementations§

Source§

impl Clone for OutputOptions

Source§

fn clone(&self) -> OutputOptions

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 OutputOptions

Source§

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

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

impl Default for OutputOptions

Source§

fn default() -> OutputOptions

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

impl<'de> Deserialize<'de> for OutputOptions

Source§

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

Deserialize this value from the given Serde deserializer. 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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.