Skip to main content

Module openapi

Module openapi 

Source
Expand description

OpenAPI schema helpers: Example wrapper and DeprecatedField marker.

§Example<T>

A transparent newtype that carries a typed value alongside schema metadata so OpenAPI generators can surface inline examples.

use api_bones::openapi::Example;

let ex: Example<u32> = Example::new(42);
assert_eq!(*ex, 42);

§DeprecatedField

A transparent newtype that marks a schema field as deprecated in the generated OpenAPI output and optionally carries a replacement hint.

use api_bones::openapi::DeprecatedField;

let d = DeprecatedField::new("old_name").with_replacement("new_name");
assert_eq!(d.replacement(), Some("new_name"));

Structs§

DeprecatedField
A transparent wrapper that marks a schema field as deprecated in the generated OpenAPI output.
Example
A transparent wrapper that carries a typed value for OpenAPI example.