mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
fix: Add ToSchema derives and register theme endpoints in OpenAPI
- Add utoipa::ToSchema derives to ThemePreset and ThemeColors - Register get_theme_presets and apply_theme_preset in OpenAPI paths - Add ThemePresetsResponse and ApplyPresetRequest to OpenAPI schemas - This enables frontend TypeScript client generation for theme APIs
This commit is contained in:
@@ -360,6 +360,8 @@ derive_utoipa!(Icon as IconSchema);
|
||||
super::routes::config_management::get_pricing,
|
||||
super::routes::config_management::get_theme_variables,
|
||||
super::routes::config_management::save_theme,
|
||||
super::routes::config_management::get_theme_presets,
|
||||
super::routes::config_management::apply_theme_preset,
|
||||
super::routes::prompts::get_prompts,
|
||||
super::routes::prompts::get_prompt,
|
||||
super::routes::prompts::save_prompt,
|
||||
@@ -450,6 +452,10 @@ derive_utoipa!(Icon as IconSchema);
|
||||
super::routes::config_management::PricingData,
|
||||
super::routes::config_management::ThemeVariablesResponse,
|
||||
super::routes::config_management::SaveThemeRequest,
|
||||
super::routes::config_management::ThemePresetsResponse,
|
||||
super::routes::config_management::ApplyPresetRequest,
|
||||
super::theme_presets::ThemePreset,
|
||||
super::theme_presets::ThemeColors,
|
||||
super::routes::prompts::PromptsListResponse,
|
||||
super::routes::prompts::PromptContentResponse,
|
||||
super::routes::prompts::SavePromptRequest,
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
|
||||
pub struct ThemePreset {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
@@ -17,7 +18,7 @@ pub struct ThemePreset {
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
|
||||
pub struct ThemeColors {
|
||||
pub light: HashMap<String, String>,
|
||||
pub dark: HashMap<String, String>,
|
||||
|
||||
Reference in New Issue
Block a user