Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
zelosleone committed Jan 6, 2025
1 parent ebdea07 commit 4ec66d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion golem-cli/src/clients/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ pub trait ComponentClient {
urn: &ComponentUrn,
installation_id: &Uuid,
) -> Result<(), GolemError>;
}
}
7 changes: 3 additions & 4 deletions golem-cli/src/model/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use golem_wasm_ast::analysis::{
use rib::{ParsedFunctionName, ParsedFunctionSite};
use serde::{Deserialize, Serialize};
use tracing::info;
use test_r::test;

#[derive(Debug, Clone, PartialEq)]
pub struct Component {
Expand Down Expand Up @@ -398,7 +397,7 @@ mod tests {
assert_eq!(repr, "abc() -> handle<1>")
}

#[test_r::test]
#[test]
fn show_params_and_results_wave() {
let f = AnalysedFunction {
name: "abc".to_string(),
Expand Down Expand Up @@ -429,7 +428,7 @@ mod tests {
assert_eq!(repr, "abc(n1: bool, n2: bool) -> (bool, bool)")
}

#[test_r::test]
#[test]
fn show_params_and_results_custom() {
let f = AnalysedFunction {
name: "abc".to_string(),
Expand Down Expand Up @@ -612,4 +611,4 @@ mod tests {
fn same_export_for_bool() {
ensure_same_export(bool(), "bool")
}
}
}
10 changes: 5 additions & 5 deletions golem-cli/src/oss/clients/api_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use golem_worker_service_base::gateway_api_definition::http::{
swagger_ui::{create_api_route, SwaggerUiConfig, SwaggerUiAuthConfig},
rib_converter::{RibConverter, fix_additional_properties},
};
use golem_wasm_ast::analysis::{AnalysedType, TypeRecord, NameTypePair, TypeStr, TypeList, TypeBool};
use golem_wasm_ast::analysis::{AnalysedType, TypeRecord, NameTypePair, TypeStr, TypeList, TypeBool, TypeOption};
use poem::listener::TcpListener;
use poem_openapi::{
OpenApi,
Expand Down Expand Up @@ -189,7 +189,7 @@ impl LocalApiDefinition {
name: "routes".to_string(),
typ: AnalysedType::List(TypeList {
inner: Box::new(AnalysedType::Record(TypeRecord {
fields: self.0.routes.iter().map(|route| vec![
fields: self.0.routes.iter().flat_map(|route| [
NameTypePair {
name: "method".to_string(),
typ: AnalysedType::Str(TypeStr),
Expand All @@ -201,8 +201,8 @@ impl LocalApiDefinition {
NameTypePair {
name: "security".to_string(),
typ: match &route.security {
Some(_) => AnalysedType::Option(Box::new(AnalysedType::Str(TypeStr))),
None => AnalysedType::Option(Box::new(AnalysedType::Str(TypeStr))),
Some(_) => AnalysedType::Option(TypeOption { inner: Box::new(AnalysedType::Str(TypeStr)) }),
None => AnalysedType::Option(TypeOption { inner: Box::new(AnalysedType::Str(TypeStr)) }),
},
},
]).collect(),
Expand All @@ -215,7 +215,7 @@ impl LocalApiDefinition {
},
NameTypePair {
name: "created_at".to_string(),
typ: AnalysedType::Option(Box::new(AnalysedType::Str(TypeStr))),
typ: AnalysedType::Option(TypeOption { inner: Box::new(AnalysedType::Str(TypeStr)) }),
},
],
})
Expand Down

0 comments on commit 4ec66d2

Please sign in to comment.