mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add OpenAPI documentation via Utoipa
Annotates all API handlers and model structs with Utoipa macros to generate an OpenAPI 3.0 spec at runtime. Serves an interactive Swagger UI at /api/docs and the raw JSON spec at /api/docs/openapi.json, both publicly accessible outside the auth middleware. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6002597383
commit
44d593fccc
@@ -2,13 +2,15 @@ use crate::utils::date_serializer;
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[derive(Clone, Serialize, Deserialize, ToSchema)]
|
||||
pub struct Device {
|
||||
pub mac_address: String,
|
||||
pub ipv4_address: String,
|
||||
pub vendor: String,
|
||||
#[serde(with = "date_serializer")]
|
||||
#[schema(value_type = String, format = DateTime)]
|
||||
pub last_seen: DateTime<Utc>,
|
||||
pub is_registered: bool,
|
||||
pub owner: String,
|
||||
|
||||
Reference in New Issue
Block a user