OpenApiRouteRegistry

Struct OpenApiRouteRegistry 

Source
pub struct OpenApiRouteRegistry { /* private fields */ }
Expand description

OpenAPI route registry that manages generated routes

Implementations§

Source§

impl OpenApiRouteRegistry

Source

pub fn new(spec: OpenApiSpec) -> Self

Create a new registry from an OpenAPI spec

Source

pub fn new_with_env(spec: OpenApiSpec) -> Self

Source

pub fn new_with_options(spec: OpenApiSpec, options: ValidationOptions) -> Self

Construct with explicit options

Source

pub fn clone_for_validation(&self) -> Self

Source

pub fn routes(&self) -> &[OpenApiRoute]

Get all routes

Source

pub fn spec(&self) -> &OpenApiSpec

Get the OpenAPI specification

Source

pub fn build_router(self) -> Router

Build an Axum router from the OpenAPI spec (simplified)

Source

pub fn build_router_with_latency( self, latency_injector: LatencyInjector, ) -> Router

Build an Axum router from the OpenAPI spec with latency injection support

Source

pub fn build_router_with_injectors( self, latency_injector: LatencyInjector, failure_injector: Option<FailureInjector>, ) -> Router

Build an Axum router from the OpenAPI spec with both latency and failure injection support

Source

pub fn build_router_with_injectors_and_overrides( self, latency_injector: LatencyInjector, failure_injector: Option<FailureInjector>, overrides: Option<Overrides>, overrides_enabled: bool, ) -> Router

Build an Axum router from the OpenAPI spec with latency, failure injection, and overrides support

Source

pub fn get_route(&self, path: &str, method: &str) -> Option<&OpenApiRoute>

Get route by path and method

Source

pub fn get_routes_for_path(&self, path: &str) -> Vec<&OpenApiRoute>

Get all routes for a specific path

Source

pub fn validate_request( &self, path: &str, method: &str, body: Option<&Value>, ) -> Result<()>

Validate request against OpenAPI spec (legacy body-only)

Source

pub fn validate_request_with( &self, path: &str, method: &str, path_params: &Map<String, Value>, query_params: &Map<String, Value>, body: Option<&Value>, ) -> Result<()>

Validate request against OpenAPI spec with path/query params

Source

pub fn validate_request_with_all( &self, path: &str, method: &str, path_params: &Map<String, Value>, query_params: &Map<String, Value>, header_params: &Map<String, Value>, cookie_params: &Map<String, Value>, body: Option<&Value>, ) -> Result<()>

Validate request against OpenAPI spec with path/query/header/cookie params

Source

pub fn paths(&self) -> Vec<String>

Get all paths defined in the spec

Source

pub fn methods(&self) -> Vec<String>

Get all HTTP methods supported

Source

pub fn get_operation( &self, path: &str, method: &str, ) -> Option<OpenApiOperation>

Get operation details for a route

Source

pub fn extract_path_parameters( &self, path: &str, method: &str, ) -> HashMap<String, String>

Extract path parameters from a request path by matching against known routes

Source

pub fn convert_path_to_axum(openapi_path: &str) -> String

Convert OpenAPI path to Axum-compatible path This is a utility function for converting path parameters from {param} to :param format

Source

pub fn build_router_with_ai( &self, ai_generator: Option<Arc<dyn AiGenerator + Send + Sync>>, ) -> Router

Build router with AI generator support

Trait Implementations§

Source§

impl Clone for OpenApiRouteRegistry

Source§

fn clone(&self) -> OpenApiRouteRegistry

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 OpenApiRouteRegistry

Source§

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

Formats the value using the given formatter. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> ParallelSend for T