diff --git a/src/helpers/utils.rs b/src/helpers/utils.rs index 4a73c19..1393690 100644 --- a/src/helpers/utils.rs +++ b/src/helpers/utils.rs @@ -7,7 +7,7 @@ use serde::de::DeserializeOwned; pub const WEB_SERVER_PROJECT_PATH: &str = "src/templates/web_server"; pub const WEB_APP_PROJECT_PATH: &str = "src/templates/web_app"; -pub const API_SCHEMA_JSON: &str = "schemas/api_schema.json"; +pub const API_SCHEMA_JSON: &str = "src/templates/web_server/schema/api_schema.json"; const CODE_TEMPLATE_PATH: &str = "src/templates/web_server/src/code_template.rs"; const EXEC_MAIN_PATH: &str = "src/templates/web_server/src/main.rs"; diff --git a/src/models/agents/agent_backend.rs b/src/models/agents/agent_backend.rs index d33ae02..1b20bf4 100644 --- a/src/models/agents/agent_backend.rs +++ b/src/models/agents/agent_backend.rs @@ -307,7 +307,14 @@ impl SpecialFunctions for AgentBackendDeveloper { let endpoints_to_check: Vec = self .extract_and_test_rest_api_endpoints(&api_endpoints_str) .await; - fact_sheet.api_endpoint_schema = Some(endpoints_to_check.clone()); + + let api_endpoint_full_schema: Vec = + serde_json::from_str(&api_endpoints_str).expect( + format!("Failed to decode API endpoints: {}", &api_endpoints_str) + .as_str(), + ); + + fact_sheet.api_endpoint_schema = Some(api_endpoint_full_schema); self.run_code(&endpoints_to_check).await; save_api_endpoints(&api_endpoints_str); diff --git a/schemas/api_schema.json b/src/templates/web_server/schema/api_schema.json similarity index 100% rename from schemas/api_schema.json rename to src/templates/web_server/schema/api_schema.json