pub struct ApiOperation {
pub operation_id: Option<String>,
pub method: HttpMethod,
pub path: String,
pub summary: Option<String>,
pub description: Option<String>,
pub tags: Vec<String>,
pub parameters: Vec<ApiParameter>,
pub request_body: Option<ApiRequestBody>,
pub responses: Vec<ApiResponse>,
pub deprecated: bool,
}Expand description
API endpoint operation.
Fields§
§operation_id: Option<String>Unique operation ID.
method: HttpMethodHTTP method.
path: StringURL path.
summary: Option<String>Short summary.
description: Option<String>Full description.
Tags for grouping.
parameters: Vec<ApiParameter>Parameters (path, query, header).
request_body: Option<ApiRequestBody>Request body.
responses: Vec<ApiResponse>Response definitions.
deprecated: boolWhether the endpoint is deprecated.
Implementations§
Source§impl ApiOperation
impl ApiOperation
Sourcepub fn slug(&self) -> String
pub fn slug(&self) -> String
Generate a URL-friendly slug for this operation.
Uses operation_id if present (camelCase → kebab-case), otherwise
falls back to method-path format.
Sourcepub fn generate_curl(&self, base_url: &str) -> String
pub fn generate_curl(&self, base_url: &str) -> String
Generate a curl command for this endpoint.
Sourcepub fn generate_response_example(&self) -> Option<(String, String)>
pub fn generate_response_example(&self) -> Option<(String, String)>
Generate a response example from the first 2xx response.
Returns Some((status_code, pretty_json)) if a 2xx response with
content schema is found, None otherwise.
Trait Implementations§
Source§impl Clone for ApiOperation
impl Clone for ApiOperation
Source§fn clone(&self) -> ApiOperation
fn clone(&self) -> ApiOperation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiOperation
impl Debug for ApiOperation
Source§impl PartialEq for ApiOperation
impl PartialEq for ApiOperation
impl StructuralPartialEq for ApiOperation
Auto Trait Implementations§
impl Freeze for ApiOperation
impl RefUnwindSafe for ApiOperation
impl Send for ApiOperation
impl Sync for ApiOperation
impl Unpin for ApiOperation
impl UnsafeUnpin for ApiOperation
impl UnwindSafe for ApiOperation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.