Skip to content

Commit

Permalink
feat: init for open api
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Aug 15, 2023
1 parent 1cec4b3 commit 314db4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ ArchGuard APIs:

GET http://127.0.0.1:8765/api/query?q=create%20arch%20system&repo_ref=archguard&query_type=HttpApi


### 3. TEXT EMBEDDING

GET http://127.0.0.1:8765/api/text-embedding?q=create%20arch%20system
Expand Down
4 changes: 4 additions & 0 deletions counit-server/src/repository/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub enum PayloadType {
Comment,
Doc,
HttpApi,
OpenApi,
}

impl Default for PayloadType {
Expand All @@ -57,6 +58,7 @@ impl PayloadType {
"comment" => PayloadType::Comment,
"doc" => PayloadType::Doc,
"http_api" => PayloadType::HttpApi,
"open_api" => PayloadType::OpenApi,
_ => PayloadType::Code,
}
}
Expand All @@ -69,6 +71,7 @@ impl std::fmt::Display for PayloadType {
PayloadType::Comment => write!(f, "comment"),
PayloadType::Doc => write!(f, "doc"),
PayloadType::HttpApi => write!(f, "http_api"),
PayloadType::OpenApi => write!(f, "open_api"),
}
}
}
Expand All @@ -80,6 +83,7 @@ impl Into<Value> for PayloadType {
PayloadType::Comment => Value::from("comment"),
PayloadType::Doc => Value::from("doc"),
PayloadType::HttpApi => Value::from("http_api"),
PayloadType::OpenApi => Value::from("open_api"),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion counit-server/src/server/archguard_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub async fn save_openapi(
params.path.as_str(),
item.display_text.as_str(),
params.language.as_str(),
PayloadType::HttpApi,
PayloadType::OpenApi,
item.display_text.as_str(),
).await;
});
Expand Down

0 comments on commit 314db4b

Please sign in to comment.