Crate utoipa_config

source
Expand description

This crate provides global configuration capabilities for utoipa.

§Config options

  • Define rust type aliases for utoipa with .alias_for(...) method.
  • Define schema collect mode for utoipa with .schema_collect(...) method.

§Install

Add dependency declaration to Cargo.toml.

[build-dependencies]
utoipa-config = "0.1"

§Examples

Create build.rs file with following content, then in your code you can just use MyType as alternative for i32.

use utoipa_config::Config;

fn main() {
    Config::new()
        .alias_for("MyType", "i32")
        .write_to_file();
}

See full example for utoipa-config.

Structs§

  • Global configuration initialized in build.rs of user project.

Enums§

  • Configures schema collect mode. By default only non explicitly inlined schemas are collected. but this behavior can be changed to collect also inlined schemas by setting SchemaCollect::All.