Skip to content

Commit

Permalink
refactor: schema.json is now part of web_server template
Browse files Browse the repository at this point in the history
  • Loading branch information
ffmcgee725 committed Jun 9, 2024
1 parent 0490d05 commit 2ea6b54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/helpers/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
9 changes: 8 additions & 1 deletion src/models/agents/agent_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,14 @@ impl SpecialFunctions for AgentBackendDeveloper {
let endpoints_to_check: Vec<RouteObject> = 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<RouteObject> =
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);
Expand Down
File renamed without changes.

0 comments on commit 2ea6b54

Please sign in to comment.