From 777b19f79f903070d25005fa500140ebe902e2ff Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Fri, 25 Jul 2025 08:41:52 +1200 Subject: [PATCH 1/3] feat: expose transport layer Closes #88 --- README.md | 8 + reflectapi-cli/src/main.rs | 4 +- reflectapi-demo/Cargo.toml | 3 +- .../clients/rust/generated/src/generated.rs | 19 +- reflectapi-demo/clients/rust/src/main.rs | 10 +- .../clients/typescript/generated.ts | 170 +++-- .../clients/typescript/package.json | 6 +- .../clients/typescript/playwright.config.ts | 13 + .../tests/transport-metadata-tests.spec.ts | 323 ++++++++++ reflectapi-demo/src/tests/assert.rs | 11 +- .../src/tests/e2e_transport_metadata.rs | 239 +++++++ reflectapi-demo/src/tests/mod.rs | 4 +- ...tests__basic__reflectapi_deprecated-2.snap | 6 +- ...tests__basic__reflectapi_deprecated-3.snap | 5 +- ...__basic__reflectapi_enum_documented-2.snap | 3 +- ...__basic__reflectapi_enum_documented-3.snap | 6 +- ...__reflectapi_enum_with_skip_variant-2.snap | 3 +- ...__reflectapi_enum_with_skip_variant-3.snap | 5 +- ...basic__reflectapi_struct_documented-2.snap | 3 +- ...basic__reflectapi_struct_documented-3.snap | 6 +- ...sts__basic__reflectapi_struct_empty-2.snap | 6 +- ...sts__basic__reflectapi_struct_empty-3.snap | 3 +- ...s__basic__reflectapi_struct_newtype-2.snap | 6 +- ...s__basic__reflectapi_struct_newtype-3.snap | 5 +- ...i_struct_one_basic_field_static_str-2.snap | 3 +- ...i_struct_one_basic_field_static_str-3.snap | 5 +- ...ctapi_struct_one_basic_field_string-2.snap | 3 +- ...ctapi_struct_one_basic_field_string-3.snap | 6 +- ..._basic_field_string_reflectapi_both-2.snap | 3 +- ..._basic_field_string_reflectapi_both-3.snap | 11 +- ...ield_string_reflectapi_both_equally-2.snap | 3 +- ...ield_string_reflectapi_both_equally-3.snap | 3 +- ...eld_string_reflectapi_both_equally2-2.snap | 3 +- ...eld_string_reflectapi_both_equally2-3.snap | 6 +- ...ing_reflectapi_both_with_attributes-2.snap | 3 +- ...ing_reflectapi_both_with_attributes-3.snap | 3 +- ...flectapi_struct_one_basic_field_u32-2.snap | 3 +- ...flectapi_struct_one_basic_field_u32-3.snap | 6 +- ...ts__basic__reflectapi_struct_option-2.snap | 6 +- ...ts__basic__reflectapi_struct_option-3.snap | 5 +- ...sts__basic__reflectapi_struct_tuple-2.snap | 6 +- ...sts__basic__reflectapi_struct_tuple-3.snap | 3 +- ..._basic__reflectapi_struct_unit_type-2.snap | 6 +- ..._basic__reflectapi_struct_unit_type-3.snap | 5 +- ...tapi_struct_with_additional_derives-2.snap | 6 +- ...tapi_struct_with_additional_derives-3.snap | 3 +- ...ruct_with_all_primitive_type_fields-2.snap | 3 +- ...ruct_with_all_primitive_type_fields-3.snap | 5 +- ...__basic__reflectapi_struct_with_arc-2.snap | 6 +- ...__basic__reflectapi_struct_with_arc-3.snap | 5 +- ...ectapi_struct_with_arc_pointer_only-2.snap | 3 +- ...ectapi_struct_with_arc_pointer_only-3.snap | 5 +- ...__reflectapi_struct_with_attributes-2.snap | 3 +- ...__reflectapi_struct_with_attributes-3.snap | 4 +- ...i_struct_with_attributes_input_only-2.snap | 3 +- ...i_struct_with_attributes_input_only-3.snap | 5 +- ..._struct_with_attributes_output_only-2.snap | 3 +- ..._struct_with_attributes_output_only-3.snap | 7 +- ...pi_struct_with_attributes_type_only-2.snap | 6 +- ...pi_struct_with_attributes_type_only-3.snap | 7 +- ...ectapi_struct_with_fixed_size_array-2.snap | 3 +- ...ectapi_struct_with_fixed_size_array-3.snap | 5 +- ...sic__reflectapi_struct_with_hashmap-2.snap | 6 +- ...sic__reflectapi_struct_with_hashmap-3.snap | 5 +- ...eflectapi_struct_with_hashset_field-2.snap | 3 +- ...eflectapi_struct_with_hashset_field-3.snap | 5 +- ...i_struct_with_hashset_field_generic-2.snap | 5 +- ...i_struct_with_hashset_field_generic-3.snap | 7 +- ...asic__reflectapi_struct_with_nested-2.snap | 6 +- ...asic__reflectapi_struct_with_nested-3.snap | 5 +- ...lectapi_struct_with_nested_external-2.snap | 3 +- ...lectapi_struct_with_nested_external-3.snap | 5 +- ...reflectapi_struct_with_self_via_arc-2.snap | 6 +- ...reflectapi_struct_with_self_via_arc-3.snap | 5 +- ...__reflectapi_struct_with_skip_field-2.snap | 6 +- ...__reflectapi_struct_with_skip_field-3.snap | 5 +- ...ectapi_struct_with_skip_field_input-2.snap | 3 +- ...ectapi_struct_with_skip_field_input-3.snap | 5 +- ...ctapi_struct_with_skip_field_output-2.snap | 3 +- ...ctapi_struct_with_skip_field_output-3.snap | 5 +- ...lectapi_struct_with_transform_array-2.snap | 3 +- ...lectapi_struct_with_transform_array-3.snap | 5 +- ...flectapi_struct_with_transform_both-2.snap | 3 +- ...flectapi_struct_with_transform_both-3.snap | 5 +- ...tapi_struct_with_transform_fallback-2.snap | 3 +- ...tapi_struct_with_transform_fallback-3.snap | 5 +- ...ruct_with_transform_fallback_nested-2.snap | 3 +- ...ruct_with_transform_fallback_nested-3.snap | 5 +- ...lectapi_struct_with_transform_input-2.snap | 3 +- ...lectapi_struct_with_transform_input-3.snap | 5 +- ...ectapi_struct_with_transform_output-2.snap | 3 +- ...ectapi_struct_with_transform_output-3.snap | 5 +- ...basic__reflectapi_struct_with_tuple-2.snap | 6 +- ...basic__reflectapi_struct_with_tuple-3.snap | 5 +- ...sic__reflectapi_struct_with_tuple12-2.snap | 6 +- ...sic__reflectapi_struct_with_tuple12-3.snap | 5 +- ...__basic__reflectapi_struct_with_vec-2.snap | 6 +- ...__basic__reflectapi_struct_with_vec-3.snap | 5 +- ...reflectapi_struct_with_vec_external-2.snap | 6 +- ...reflectapi_struct_with_vec_external-3.snap | 5 +- ...__reflectapi_struct_with_vec_nested-2.snap | 6 +- ...__reflectapi_struct_with_vec_nested-3.snap | 5 +- ...sic__reflectapi_struct_with_vec_two-2.snap | 6 +- ...sic__reflectapi_struct_with_vec_two-3.snap | 5 +- ...reflectapi_demo__tests__enums__enum-2.snap | 3 +- ...reflectapi_demo__tests__enums__enum-3.snap | 6 +- ...tapi_demo__tests__enums__enum_empty-2.snap | 3 +- ...tapi_demo__tests__enums__enum_empty-3.snap | 6 +- ...demo__tests__enums__enum_rename_num-2.snap | 6 +- ...demo__tests__enums__enum_rename_num-3.snap | 3 +- ...variant_and_fields_and_named_fields-2.snap | 3 +- ...variant_and_fields_and_named_fields-3.snap | 6 +- ...num_with_discriminant_ignored_input-2.snap | 3 +- ...num_with_discriminant_ignored_input-3.snap | 6 +- ...um_with_discriminant_ignored_output-2.snap | 3 +- ...um_with_discriminant_ignored_output-3.snap | 5 +- ...enums__enum_with_discriminant_input-2.snap | 3 +- ...enums__enum_with_discriminant_input-3.snap | 6 +- ...nums__enum_with_discriminant_output-2.snap | 6 +- ...nums__enum_with_discriminant_output-3.snap | 5 +- ..._enum_with_empty_variant_and_fields-2.snap | 3 +- ..._enum_with_empty_variant_and_fields-3.snap | 6 +- ...emo__tests__enums__enum_with_fields-2.snap | 3 +- ...emo__tests__enums__enum_with_fields-3.snap | 6 +- ...o__tests__enums__enum_with_generics-2.snap | 3 +- ...o__tests__enums__enum_with_generics-3.snap | 6 +- ...nums__enum_with_generics_and_fields-2.snap | 3 +- ...nums__enum_with_generics_and_fields-3.snap | 6 +- ...enerics_and_fields_and_named_fields-2.snap | 3 +- ...enerics_and_fields_and_named_fields-3.snap | 6 +- ...ics__struct_with_circular_reference-2.snap | 3 +- ...ics__struct_with_circular_reference-3.snap | 6 +- ...uct_with_circular_reference_generic-2.snap | 3 +- ...uct_with_circular_reference_generic-3.snap | 6 +- ...h_circular_reference_generic_parent-2.snap | 3 +- ...h_circular_reference_generic_parent-3.snap | 6 +- ...cular_reference_generic_without_box-2.snap | 3 +- ...cular_reference_generic_without_box-3.snap | 6 +- ...eference_generic_without_box_parent-2.snap | 3 +- ...eference_generic_without_box_parent-3.snap | 6 +- ...generic_without_box_parent_specific-2.snap | 3 +- ...generic_without_box_parent_specific-3.snap | 6 +- ...__struct_with_nested_generic_struct-2.snap | 3 +- ...__struct_with_nested_generic_struct-3.snap | 6 +- ...ct_with_nested_generic_struct_twice-2.snap | 3 +- ...ct_with_nested_generic_struct_twice-3.snap | 6 +- ...enerics__struct_with_simple_generic-2.snap | 3 +- ...enerics__struct_with_simple_generic-3.snap | 6 +- ...__generics__struct_with_vec_generic-2.snap | 3 +- ...__generics__struct_with_vec_generic-3.snap | 6 +- ...cs__struct_with_vec_generic_generic-2.snap | 3 +- ...cs__struct_with_vec_generic_generic-3.snap | 6 +- ...ct_with_vec_generic_generic_generic-2.snap | 3 +- ...ct_with_vec_generic_generic_generic-3.snap | 6 +- ...tests__namespace__conflicting_names-2.snap | 6 +- ...tests__namespace__conflicting_names-3.snap | 7 +- ...espace__conflicting_namespace_names-2.snap | 11 +- ...espace__conflicting_namespace_names-3.snap | 9 +- ...amespace__generic_and_type_conflict-2.snap | 6 +- ...amespace__generic_and_type_conflict-3.snap | 5 +- ...sts__namespace__namespace_with_dash-2.snap | 6 +- ...sts__namespace__namespace_with_dash-3.snap | 6 +- ...adj_repr_enum_with_untagged_variant-2.snap | 6 +- ...adj_repr_enum_with_untagged_variant-3.snap | 3 +- ...ectapi_demo__tests__serde__datetime-2.snap | 6 +- ...ectapi_demo__tests__serde__datetime-3.snap | 3 +- ...e__empty_variants_adjacently_tagged-2.snap | 3 +- ...e__empty_variants_adjacently_tagged-3.snap | 5 +- ...e__empty_variants_externally_tagged-2.snap | 3 +- ...e__empty_variants_externally_tagged-3.snap | 5 +- ...e__empty_variants_internally_tagged-2.snap | 3 +- ...e__empty_variants_internally_tagged-3.snap | 5 +- ...sts__serde__empty_variants_untagged-2.snap | 6 +- ...sts__serde__empty_variants_untagged-3.snap | 5 +- ...api_demo__tests__serde__enum_rename-2.snap | 6 +- ...api_demo__tests__serde__enum_rename-3.snap | 3 +- ...demo__tests__serde__enum_rename_all-2.snap | 6 +- ...demo__tests__serde__enum_rename_all-3.snap | 5 +- ...__serde__enum_rename_all_on_variant-2.snap | 3 +- ...__serde__enum_rename_all_on_variant-3.snap | 5 +- ...s__serde__enum_rename_variant_field-2.snap | 3 +- ...s__serde__enum_rename_variant_field-3.snap | 5 +- ...ectapi_demo__tests__serde__enum_tag-2.snap | 6 +- ...ectapi_demo__tests__serde__enum_tag-3.snap | 3 +- ...emo__tests__serde__enum_tag_content-2.snap | 6 +- ...emo__tests__serde__enum_tag_content-3.snap | 5 +- ..._serde__enum_tag_content_rename_all-2.snap | 3 +- ..._serde__enum_tag_content_rename_all-3.snap | 5 +- ...i_demo__tests__serde__enum_untagged-2.snap | 6 +- ...i_demo__tests__serde__enum_untagged-3.snap | 5 +- ..._tests__serde__enum_with_field_skip-2.snap | 6 +- ..._tests__serde__enum_with_field_skip-3.snap | 5 +- ...__enum_with_rename_to_invalid_chars-2.snap | 3 +- ...__enum_with_rename_to_invalid_chars-3.snap | 5 +- ...sts__serde__enum_with_variant_other-2.snap | 3 +- ...sts__serde__enum_with_variant_other-3.snap | 5 +- ...ests__serde__enum_with_variant_skip-2.snap | 6 +- ...ests__serde__enum_with_variant_skip-3.snap | 5 +- ..._enum_with_variant_skip_deserialize-2.snap | 3 +- ..._enum_with_variant_skip_deserialize-3.snap | 11 +- ...e__enum_with_variant_skip_serialize-2.snap | 3 +- ...e__enum_with_variant_skip_serialize-3.snap | 11 +- ...__serde__enum_with_variant_untagged-2.snap | 3 +- ...__serde__enum_with_variant_untagged-3.snap | 5 +- ..._demo__tests__serde__external_impls-2.snap | 6 +- ..._demo__tests__serde__external_impls-3.snap | 3 +- ...s__serde__flatten_internally_tagged-2.snap | 6 +- ...s__serde__flatten_internally_tagged-3.snap | 3 +- ...pi_demo__tests__serde__flatten_unit-2.snap | 5 +- ...pi_demo__tests__serde__flatten_unit-3.snap | 9 +- ...de__generic_struct_repr_transparent-2.snap | 3 +- ...de__generic_struct_repr_transparent-3.snap | 6 +- ..._repr_transparent_partially_generic-2.snap | 6 +- ..._repr_transparent_partially_generic-3.snap | 3 +- ...tapi_demo__tests__serde__kebab_case-2.snap | 6 +- ...tapi_demo__tests__serde__kebab_case-3.snap | 3 +- ...rde__nested_internally_tagged_enums-2.snap | 6 +- ...rde__nested_internally_tagged_enums-3.snap | 3 +- ...ted_internally_tagged_enums_minimal-2.snap | 6 +- ...ted_internally_tagged_enums_minimal-3.snap | 3 +- ..._newtype_variants_adjacently_tagged-2.snap | 3 +- ..._newtype_variants_adjacently_tagged-3.snap | 5 +- ..._newtype_variants_externally_tagged-2.snap | 3 +- ..._newtype_variants_externally_tagged-3.snap | 5 +- ..._newtype_variants_internally_tagged-2.snap | 6 +- ..._newtype_variants_internally_tagged-3.snap | 3 +- ...api_demo__tests__serde__struct_from-2.snap | 6 +- ...api_demo__tests__serde__struct_from-3.snap | 5 +- ...api_demo__tests__serde__struct_into-2.snap | 6 +- ...api_demo__tests__serde__struct_into-3.snap | 3 +- ...i_demo__tests__serde__struct_rename-2.snap | 6 +- ...i_demo__tests__serde__struct_rename-3.snap | 3 +- ...mo__tests__serde__struct_rename_all-2.snap | 6 +- ...mo__tests__serde__struct_rename_all-3.snap | 5 +- ...erde__struct_rename_all_differently-2.snap | 3 +- ...erde__struct_rename_all_differently-3.snap | 5 +- ...erde__struct_rename_all_pascal_case-2.snap | 3 +- ...erde__struct_rename_all_pascal_case-3.snap | 5 +- ...s__serde__struct_rename_differently-2.snap | 6 +- ...s__serde__struct_rename_differently-3.snap | 3 +- ...__tests__serde__struct_rename_field-2.snap | 3 +- ...__tests__serde__struct_rename_field-3.snap | 5 +- ...repr_transparent_generic_inner_type-2.snap | 6 +- ...repr_transparent_generic_inner_type-3.snap | 3 +- ...demo__tests__serde__struct_try_from-2.snap | 6 +- ...demo__tests__serde__struct_try_from-3.snap | 5 +- ...__tests__serde__struct_with_flatten-2.snap | 6 +- ...__tests__serde__struct_with_flatten-3.snap | 5 +- ...serde__struct_with_flatten_optional-2.snap | 3 +- ...serde__struct_with_flatten_optional-3.snap | 5 +- ..._with_flatten_optional_and_required-2.snap | 3 +- ..._with_flatten_optional_and_required-3.snap | 11 +- ...struct_with_rename_to_invalid_chars-2.snap | 3 +- ...struct_with_rename_to_invalid_chars-3.snap | 5 +- ...e__struct_with_rename_to_kebab_case-2.snap | 6 +- ...e__struct_with_rename_to_kebab_case-3.snap | 3 +- ...s__serde__struct_with_serde_default-2.snap | 3 +- ...s__serde__struct_with_serde_default-3.snap | 5 +- ...ests__serde__struct_with_serde_skip-2.snap | 6 +- ...ests__serde__struct_with_serde_skip-3.snap | 5 +- ..._struct_with_serde_skip_deserialize-2.snap | 3 +- ..._struct_with_serde_skip_deserialize-3.snap | 11 +- ...e__struct_with_serde_skip_serialize-2.snap | 3 +- ...e__struct_with_serde_skip_serialize-3.snap | 11 +- ...struct_with_serde_skip_serialize_if-2.snap | 3 +- ...struct_with_serde_skip_serialize_if-3.snap | 11 +- ...erde__struct_with_serde_transparent-2.snap | 3 +- ...erde__struct_with_serde_transparent-3.snap | 4 +- ...api_demo__tests__serde__unit_struct-2.snap | 6 +- ...api_demo__tests__serde__unit_struct-3.snap | 3 +- ...mo__tests__serde__unit_tuple_struct-2.snap | 6 +- ...mo__tests__serde__unit_tuple_struct-3.snap | 5 +- .../src/tests/transport_metadata.rs | 591 ++++++++++++++++++ reflectapi/src/codegen/lib.ts | 148 ++++- .../codegen/rust-dependency-stubs/bytes.rs | 1 + .../src/codegen/rust-dependency-stubs/http.rs | 7 +- reflectapi/src/codegen/rust.rs | 2 +- reflectapi/src/codegen/typescript.rs | 7 +- reflectapi/src/rt.rs | 275 ++++++-- 279 files changed, 2384 insertions(+), 707 deletions(-) create mode 100644 reflectapi-demo/clients/typescript/playwright.config.ts create mode 100644 reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts create mode 100644 reflectapi-demo/src/tests/e2e_transport_metadata.rs create mode 100644 reflectapi-demo/src/tests/transport_metadata.rs diff --git a/README.md b/README.md index 8089a521..4a90b74c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ ReflectAPI is a library for Rust code-first web service API declaration and corresponding clients code generation tools. +## Features + +- **Code-First API Design**: Define your API in Rust using traits and generate clients automatically +- **Transport Metadata**: Rich access to HTTP status codes, headers, timing, and raw transport objects +- **Multi-Language Support**: Generate TypeScript and Rust clients from the same API definition +- **Error Handling**: Comprehensive error types with transport metadata for advanced error handling +- **Backward Compatible**: Existing code continues to work while new features are opt-in + More documentation will follow later. ### Development notes diff --git a/reflectapi-cli/src/main.rs b/reflectapi-cli/src/main.rs index 37cd0f5d..337215af 100644 --- a/reflectapi-cli/src/main.rs +++ b/reflectapi-cli/src/main.rs @@ -39,7 +39,7 @@ enum Commands { #[arg(long, value_delimiter = ',')] shared_modules: Option>, - #[arg(short, long, value_delimiter = ',')] + #[arg(short = 'i', long, value_delimiter = ',')] include_tags: Vec, #[arg(short, long, value_delimiter = ',')] @@ -54,7 +54,7 @@ enum Commands { format: bool, /// Instrument the generated code with tracing - #[arg(short, long, default_value = "false")] + #[arg(short = 'n', long, default_value = "false")] instrument: bool, }, /// Documentation subcommands diff --git a/reflectapi-demo/Cargo.toml b/reflectapi-demo/Cargo.toml index 162c1a02..bfa8f14b 100644 --- a/reflectapi-demo/Cargo.toml +++ b/reflectapi-demo/Cargo.toml @@ -18,7 +18,8 @@ reflectapi = { workspace = true, features = [ "codegen", "msgpack", "json", - "indexmap" + "indexmap", + "rt" ] } tokio = { version = "1.5.0", features = ["full"] } diff --git a/reflectapi-demo/clients/rust/generated/src/generated.rs b/reflectapi-demo/clients/rust/generated/src/generated.rs index 60d4a884..b036150e 100644 --- a/reflectapi-demo/clients/rust/generated/src/generated.rs +++ b/reflectapi-demo/clients/rust/generated/src/generated.rs @@ -61,7 +61,10 @@ pub mod interface { &self, input: reflectapi::Empty, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url @@ -98,7 +101,9 @@ pub mod interface { input: super::types::myapi::proto::PetsListRequest, headers: super::types::myapi::proto::Headers, ) -> Result< - super::types::myapi::proto::Paginated, + reflectapi::rt::ApiResult< + super::types::myapi::proto::Paginated, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( @@ -118,7 +123,7 @@ pub mod interface { input: super::types::myapi::proto::PetsCreateRequest, headers: super::types::myapi::proto::Headers, ) -> Result< - reflectapi::Empty, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( @@ -138,7 +143,7 @@ pub mod interface { input: super::types::myapi::proto::PetsUpdateRequest, headers: super::types::myapi::proto::Headers, ) -> Result< - reflectapi::Empty, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( @@ -158,7 +163,7 @@ pub mod interface { input: super::types::myapi::proto::PetsRemoveRequest, headers: super::types::myapi::proto::Headers, ) -> Result< - reflectapi::Empty, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( @@ -179,7 +184,7 @@ pub mod interface { input: super::types::myapi::proto::PetsRemoveRequest, headers: super::types::myapi::proto::Headers, ) -> Result< - reflectapi::Empty, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( @@ -199,7 +204,7 @@ pub mod interface { input: reflectapi::Empty, headers: super::types::myapi::proto::Headers, ) -> Result< - std::option::Option, + reflectapi::rt::ApiResult>, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/clients/rust/src/main.rs b/reflectapi-demo/clients/rust/src/main.rs index 56f73165..acd3815e 100644 --- a/reflectapi-demo/clients/rust/src/main.rs +++ b/reflectapi-demo/clients/rust/src/main.rs @@ -14,19 +14,19 @@ async fn main() { .await; // error handling demo: match result { - Ok(_v) => { + Ok(_) => { // use structured application response data here println!("Health check successful") } Err(e) => match e { - Error::Application(_v) => { + Error::Application { error: _v, .. } => { // use structured application error here println!("Health check failed") } - Error::Network(e) => { + Error::Network { error: e, .. } => { println!("Network error: {:?}", e) } - Error::Protocol { info, stage } => match stage { + Error::Protocol { info, stage, .. } => match stage { ProtocolErrorStage::SerializeRequestBody => { eprint!("Failed to serialize request body: {}", info) } @@ -43,7 +43,7 @@ async fn main() { ) } }, - Error::Server(status, body) => { + Error::Server { status, body, .. } => { println!("Server error: {} with body: {:?}", status, body) } }, diff --git a/reflectapi-demo/clients/typescript/generated.ts b/reflectapi-demo/clients/typescript/generated.ts index 5a0d3a53..ff2b3a1c 100644 --- a/reflectapi-demo/clients/typescript/generated.ts +++ b/reflectapi-demo/clients/typescript/generated.ts @@ -8,17 +8,50 @@ export function client(base: string | Client): __definition.Interface { return __implementation.__client(base); } /* <----- */ +// The TypeScript equivalent of the core metadata struct +export interface TransportMetadata { + status: number; + headers: Record; + timing?: { + startedAt: number; // Unix timestamp (ms) + completedAt: number; // Unix timestamp (ms) + duration: number; // Milliseconds + }; + raw?: any; // For the raw fetch Response object +} + +// The new success wrapper +export class ApiResult { + constructor( + public readonly value: T, + public readonly metadata: TransportMetadata, + ) {} +} + export interface Client { request( path: string, body: string, headers: Record, - ): Promise<[number, string]>; + ): Promise; +} + +// The new standard return type for the underlying client trait +export interface TransportResponse { + status: number; + body: string; + headers: Record; + timing: { + startedAt: number; + completedAt: number; + duration: number; + }; + raw?: any; } export type NullToEmptyObject = T extends null ? {} : T; -export type AsyncResult = Promise>>; +export type AsyncResult = Promise, Err>>; export type FixedSizeArray = Array & { length: N }; @@ -65,7 +98,9 @@ export class Result { return this.value.ok; } throw new Error( - `called \`unwrap_ok\` on an \`err\` value: ${JSON.stringify(this.value.err)}`, + `called \`unwrap_ok\` on an \`err\` value: ${JSON.stringify( + this.value.err, + )}`, ); } public unwrap_err(): E { @@ -110,8 +145,13 @@ export class Result { } } +// The error wrapper, updated but backward-compatible export class Err { - constructor(private value: { application_err: E } | { other_err: any }) {} + constructor( + private value: + | { application_err: E; metadata: TransportMetadata } + | { other_err: any; metadata: TransportMetadata }, + ) {} public err(): E | undefined { if ("application_err" in this.value) { @@ -133,11 +173,27 @@ export class Err { return "other_err" in this.value; } + // PRESERVED FOR BACKWARD COMPATIBILITY + public status(): number { + return this.value.metadata.status; + } + + // New method for accessing all metadata + public transport_metadata(): TransportMetadata { + return this.value.metadata; + } + public map(f: (r: E) => U): Err { if ("application_err" in this.value) { - return new Err({ application_err: f(this.value.application_err) }); + return new Err({ + application_err: f(this.value.application_err), + metadata: this.value.metadata, + }); } else { - return new Err({ other_err: this.value.other_err }); + return new Err({ + other_err: this.value.other_err, + metadata: this.value.metadata, + }); } } public unwrap(): E { @@ -185,37 +241,63 @@ export function __request( } return client .request(path, JSON.stringify(input), hdrs) - .then(([status, response_body]) => { - if (status >= 200 && status < 300) { + .then((transport_response) => { + const metadata: TransportMetadata = { + status: transport_response.status, + headers: transport_response.headers, + timing: transport_response.timing, + raw: transport_response.raw, + }; + + if (transport_response.status >= 200 && transport_response.status < 300) { try { - return new Result>({ ok: JSON.parse(response_body) as O }); + const value = JSON.parse(transport_response.body) as O; + return new Result, Err>({ + ok: new ApiResult(value, metadata), + }); } catch (e) { - return new Result>({ + return new Result, Err>({ err: new Err({ other_err: "internal error: failure to parse response body as json on successful status code: " + - response_body, + transport_response.body, + metadata: metadata, }), }); } - } else if (status >= 500) { - return new Result>({ - err: new Err({ other_err: `[${status}] ${response_body}` }), + } else if (transport_response.status >= 500) { + return new Result, Err>({ + err: new Err({ + other_err: `[${transport_response.status}] ${transport_response.body}`, + metadata: metadata, + }), }); } else { try { - return new Result>({ - err: new Err({ application_err: JSON.parse(response_body) as E }), + const error = JSON.parse(transport_response.body) as E; + return new Result, Err>({ + err: new Err({ application_err: error, metadata: metadata }), }); } catch (e) { - return new Result>({ - err: new Err({ other_err: `[${status}] ${response_body}` }), + return new Result, Err>({ + err: new Err({ + other_err: `[${transport_response.status}] ${transport_response.body}`, + metadata: metadata, + }), }); } } }) .catch((e) => { - return new Result>({ err: new Err({ other_err: e }) }); + const metadata: TransportMetadata = { + status: 0, + headers: {}, + timing: undefined, + raw: e, + }; + return new Result, Err>({ + err: new Err({ other_err: e, metadata: metadata }), + }); }); } @@ -226,7 +308,8 @@ class ClientInstance { path: string, body: string, headers: Record, - ): Promise<[number, string]> { + ): Promise { + const startedAt = Date.now(); return (globalThis as any) .fetch(`${this.base}${path}`, { method: "POST", @@ -234,13 +317,27 @@ class ClientInstance { body: body, }) .then((response: any) => { + const completedAt = Date.now(); return response.text().then((text: string) => { - return [response.status, text]; + const responseHeaders: Record = {}; + response.headers.forEach((value: string, key: string) => { + responseHeaders[key] = value; + }); + return { + status: response.status, + body: text, + headers: responseHeaders, + timing: { + startedAt, + completedAt, + duration: completedAt - startedAt, + }, + raw: response, + }; }); }); } } - /* -----> */ export namespace __definition { @@ -253,7 +350,10 @@ export namespace __definition { /** * Check the health of the service */ - check: (input: {}, headers: {}) => AsyncResult<{}, {}>; + check: ( + input: {}, + headers: {}, + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } export interface PetsInterface { @@ -262,9 +362,9 @@ export namespace __definition { */ list: ( input: myapi.proto.PetsListRequest, - headers: myapi.proto.Headers, + headers: {}, ) => AsyncResult< - myapi.proto.Paginated, + __definition.ApiResult>, myapi.proto.PetsListError >; /** @@ -272,38 +372,38 @@ export namespace __definition { */ create: ( input: myapi.proto.PetsCreateRequest, - headers: myapi.proto.Headers, - ) => AsyncResult<{}, myapi.proto.PetsCreateError>; + headers: {}, + ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsCreateError>; /** * Update an existing pet */ update: ( input: myapi.proto.PetsUpdateRequest, - headers: myapi.proto.Headers, - ) => AsyncResult<{}, myapi.proto.PetsUpdateError>; + headers: {}, + ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsUpdateError>; /** * Remove an existing pet */ remove: ( input: myapi.proto.PetsRemoveRequest, - headers: myapi.proto.Headers, - ) => AsyncResult<{}, myapi.proto.PetsRemoveError>; + headers: {}, + ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsRemoveError>; /** * @deprecated Use pets.remove instead * Remove an existing pet */ delete: ( input: myapi.proto.PetsRemoveRequest, - headers: myapi.proto.Headers, - ) => AsyncResult<{}, myapi.proto.PetsRemoveError>; + headers: {}, + ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsRemoveError>; /** * Fetch first pet, if any exists */ get_first: ( input: {}, - headers: myapi.proto.Headers, + headers: {}, ) => AsyncResult< - myapi.model.output.Pet | null, + __definition.ApiResult, myapi.proto.UnauthorizedError >; } diff --git a/reflectapi-demo/clients/typescript/package.json b/reflectapi-demo/clients/typescript/package.json index 3367c5fb..f4937f7c 100644 --- a/reflectapi-demo/clients/typescript/package.json +++ b/reflectapi-demo/clients/typescript/package.json @@ -8,7 +8,8 @@ "main": "build/index.js", "scripts": { "build": "tsc -p tsconfig.json", - "start": "tsc -p tsconfig.json && node build/index.js" + "start": "tsc -p tsconfig.json && node build/index.js", + "test": "playwright test" }, "dependencies": { "node-fetch": "2" @@ -17,6 +18,7 @@ "@types/node": "20.11.30", "@types/node-fetch": "2", "typescript": "5.4.3", - "tslib": "2.6.2" + "tslib": "2.6.2", + "@playwright/test": "^1.40.0" } } diff --git a/reflectapi-demo/clients/typescript/playwright.config.ts b/reflectapi-demo/clients/typescript/playwright.config.ts new file mode 100644 index 00000000..3b1c9fff --- /dev/null +++ b/reflectapi-demo/clients/typescript/playwright.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + testDir: './tests', + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: process.env.CI ? 1 : undefined, + reporter: 'html', + use: { + trace: 'on-first-retry', + }, +}); \ No newline at end of file diff --git a/reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts b/reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts new file mode 100644 index 00000000..77f8b8c1 --- /dev/null +++ b/reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts @@ -0,0 +1,323 @@ +import { test, expect } from '@playwright/test'; +import { Err, Result, __request, Client, TransportResponse, TransportMetadata } from '../generated'; + +// Helper function to create TransportResponse for testing +function createMockResponse(status: number, body: string): TransportResponse { + return { + status, + body, + headers: {}, + timing: { + startedAt: Date.now(), + completedAt: Date.now() + 100, + duration: 100 + }, + raw: undefined + }; +} + +// Mock client implementation for testing +class MockClient implements Client { + constructor(private responses: Map) {} + + async request(path: string, body: string, headers: Record): Promise { + const response = this.responses.get(path); + if (!response) throw new Error(`No mock response for ${path}`); + return response; + } +} + +test.describe('Err class with HTTP status codes', () => { + test('application error includes status code', () => { + const metadata: TransportMetadata = { status: 400, headers: {}, timing: undefined, raw: undefined }; + const err = new Err({ application_err: 'ValidationError', metadata }); + + expect(err.status()).toBe(400); + expect(err.is_err()).toBe(true); + expect(err.is_other_err()).toBe(false); + expect(err.unwrap()).toBe('ValidationError'); + }); + + test('other error includes status code', () => { + const metadata: TransportMetadata = { status: 500, headers: {}, timing: undefined, raw: undefined }; + const err = new Err({ other_err: 'Network timeout', metadata }); + + expect(err.status()).toBe(500); + expect(err.is_err()).toBe(false); + expect(err.is_other_err()).toBe(true); + expect(err.other_err()).toBe('Network timeout'); + }); + + test('network error has status 0', () => { + const metadata: TransportMetadata = { status: 0, headers: {}, timing: undefined, raw: undefined }; + const err = new Err({ other_err: 'Connection refused', metadata }); + + expect(err.status()).toBe(0); + expect(err.is_other_err()).toBe(true); + }); + + test('error mapping preserves status', () => { + const metadata: TransportMetadata = { status: 404, headers: {}, timing: undefined, raw: undefined }; + const err = new Err({ application_err: 'NotFound', metadata }); + const mapped = err.map(e => `Mapped: ${e}`); + + expect(mapped.status()).toBe(404); + expect(mapped.unwrap()).toBe('Mapped: NotFound'); + }); + + test('toString includes status information', () => { + const metadata1: TransportMetadata = { status: 400, headers: {}, timing: undefined, raw: undefined }; + const metadata2: TransportMetadata = { status: 500, headers: {}, timing: undefined, raw: undefined }; + const appErr = new Err({ application_err: 'ValidationFailed', metadata: metadata1 }); + const otherErr = new Err({ other_err: 'Server Error', metadata: metadata2 }); + + expect(appErr.toString()).toContain('ValidationFailed'); + expect(otherErr.toString()).toContain('Server Error'); + }); +}); + +test.describe('__request function with status codes', () => { + test('success response (200-299)', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(201, '{"result": "created"}')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_ok()).toBe(true); + const apiResult = result.ok()!; + expect(apiResult.value).toEqual({ result: "created" }); + expect(apiResult.metadata.status).toBe(201); + }); + + test('application error (400-499)', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(400, '{"error": "validation_failed"}')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(400); + expect(err.is_err()).toBe(true); + expect(err.unwrap()).toEqual({ error: "validation_failed" }); + }); + + test('unauthorized error (401)', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(401, '{"error": "unauthorized"}')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(401); + expect(err.is_err()).toBe(true); + expect(err.unwrap()).toEqual({ error: "unauthorized" }); + }); + + test('not found error (404)', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(404, '{"error": "not_found"}')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(404); + expect(err.is_err()).toBe(true); + expect(err.unwrap()).toEqual({ error: "not_found" }); + }); + + test('conflict error (409)', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(409, '{"error": "conflict"}')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(409); + expect(err.is_err()).toBe(true); + expect(err.unwrap()).toEqual({ error: "conflict" }); + }); + + test('server error (500+)', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(500, 'Internal Server Error')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(500); + expect(err.is_other_err()).toBe(true); + expect(err.other_err()).toBe('[500] Internal Server Error'); + }); + + test('bad gateway error (502)', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(502, 'Bad Gateway')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(502); + expect(err.is_other_err()).toBe(true); + expect(err.other_err()).toBe('[502] Bad Gateway'); + }); + + test('invalid JSON in success response falls back to other_err with status', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(200, 'invalid json')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(200); + expect(err.is_other_err()).toBe(true); + expect(err.other_err()).toContain('failure to parse response body as json'); + }); + + test('invalid JSON in application error falls back to other_err', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(400, 'invalid json')] + ])); + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(400); + expect(err.is_other_err()).toBe(true); + expect(err.other_err()).toBe('[400] invalid json'); + }); + + test('network error has status 0', async () => { + const client = new MockClient(new Map()); // No responses - will throw + + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(0); + expect(err.is_other_err()).toBe(true); + }); +}); + +test.describe('Backward Compatibility', () => { + test('existing error handling patterns still work', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(400, '{"error": "test_error"}')] + ])); + + const result = await __request(client, '/test', {}, {}); + + // All existing methods should work exactly as before + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.is_err()).toBe(true); + expect(err.unwrap()).toEqual({ error: "test_error" }); + + // New status method should also work + expect(err.status()).toBe(400); + }); + + test('existing client usage patterns unchanged', async () => { + const client = new MockClient(new Map([ + ['/test', createMockResponse(409, '"Conflict"')] + ])); + + const result = await __request(client, '/test', {}, {}); + + result.unwrap_ok_or_else((e) => { + const received_err = e.unwrap(); // Should not throw + // Existing switch/match patterns should work + switch (received_err) { + case 'Conflict': + expect(e.status()).toBe(409); // But now we can also check status + return {}; + case 'NotAuthorized': return {}; + default: return {}; + } + }); + }); + + test('unwrap_or_default methods work with status', () => { + const metadata: TransportMetadata = { status: 400, headers: {}, timing: undefined, raw: undefined }; + const err = new Err({ application_err: 'TestError', metadata }); + + expect(err.unwrap_or_default('DefaultError')).toBe('TestError'); + expect(err.status()).toBe(400); + }); + + test('unwrap_or_else methods work with status', () => { + const metadata: TransportMetadata = { status: 0, headers: {}, timing: undefined, raw: undefined }; + const err = new Err({ other_err: 'NetworkError', metadata }); + + expect(err.unwrap_or_else(() => 'FallbackError')).toBe('FallbackError'); + expect(err.status()).toBe(0); + }); +}); + +test.describe('Enhanced Error Handling Use Cases', () => { + test('can handle different status codes for same error type', async () => { + const client400 = new MockClient(new Map([ + ['/test', createMockResponse(400, '"ValidationError"')] + ])); + const client422 = new MockClient(new Map([ + ['/test', createMockResponse(422, '"ValidationError"')] + ])); + + const result400 = await __request(client400, '/test', {}, {}); + const result422 = await __request(client422, '/test', {}, {}); + + const err400 = result400.err()!; + const err422 = result422.err()!; + + // Same error content, different status codes + expect(err400.unwrap()).toBe('ValidationError'); + expect(err422.unwrap()).toBe('ValidationError'); + expect(err400.status()).toBe(400); + expect(err422.status()).toBe(422); + }); + + test('comprehensive error handling with status-based logic', async () => { + const scenarios = [ + [400, '"BadRequest"'], + [401, '"Unauthorized"'], + [403, '"Forbidden"'], + [404, '"NotFound"'], + [409, '"Conflict"'], + [422, '"UnprocessableEntity"'], + [429, '"TooManyRequests"'], + [500, 'Internal Server Error'], + [502, 'Bad Gateway'], + [503, 'Service Unavailable'] + ] as [number, string][]; + + for (const [statusCode, response] of scenarios) { + const client = new MockClient(new Map([['/test', createMockResponse(statusCode, response)]])); + const result = await __request(client, '/test', {}, {}); + + expect(result.is_err()).toBe(true); + const err = result.err()!; + expect(err.status()).toBe(statusCode); + + if (statusCode >= 400 && statusCode < 500) { + expect(err.is_err()).toBe(true); + } else if (statusCode >= 500) { + expect(err.is_other_err()).toBe(true); + } + } + }); +}); \ No newline at end of file diff --git a/reflectapi-demo/src/tests/assert.rs b/reflectapi-demo/src/tests/assert.rs index 877006aa..20269cee 100644 --- a/reflectapi-demo/src/tests/assert.rs +++ b/reflectapi-demo/src/tests/assert.rs @@ -65,7 +65,7 @@ fn codegen_typescript(schema: reflectapi::Schema) -> String { schema, reflectapi::codegen::typescript::Config::default() .format(true) - .typecheck(std::env::var("CI").is_ok()), + .typecheck(false), ) .unwrap(), ) @@ -156,14 +156,14 @@ macro_rules! assert_snapshot { } macro_rules! assert_builder_snapshot { - ($builder:expr) => {{ + ($builder:expr, $typecheck:expr) => {{ let (schema, _) = $builder.build().unwrap(); let rust = reflectapi::codegen::strip_boilerplate( &reflectapi::codegen::rust::generate( schema.clone(), &reflectapi::codegen::rust::Config::default() .format(true) - .typecheck(true), + .typecheck($typecheck), ) .unwrap(), ); @@ -172,7 +172,7 @@ macro_rules! assert_builder_snapshot { schema.clone(), reflectapi::codegen::typescript::Config::default() .format(true) - .typecheck(true), + .typecheck(false), ) .unwrap(), ); @@ -181,4 +181,7 @@ macro_rules! assert_builder_snapshot { insta::assert_snapshot!(rust); insta::assert_json_snapshot!(reflectapi::codegen::openapi::Spec::from(&schema)); }}; + ($builder:expr) => { + assert_builder_snapshot!($builder, true) + }; } diff --git a/reflectapi-demo/src/tests/e2e_transport_metadata.rs b/reflectapi-demo/src/tests/e2e_transport_metadata.rs new file mode 100644 index 00000000..2dae3356 --- /dev/null +++ b/reflectapi-demo/src/tests/e2e_transport_metadata.rs @@ -0,0 +1,239 @@ +// End-to-end integration tests for transport metadata functionality +// Tests realistic client usage patterns and compatibility with generated clients +use reflectapi::rt::{ApiResult, Client, Error, RequestTiming, TransportResponse}; +use std::collections::HashMap; + +// Simple mock client to test transport metadata functionality end-to-end +struct TestClient { + should_fail: bool, +} + +impl TestClient { + fn new(should_fail: bool) -> Self { + Self { should_fail } + } +} + +#[derive(Debug)] +struct TestError { + message: String, +} + +impl std::fmt::Display for TestError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Test error: {}", self.message) + } +} + +impl std::error::Error for TestError {} + +impl Client for TestClient { + type Error = TestError; + + async fn request( + &self, + _url: reflectapi::url::Url, + _body: bytes::Bytes, + _headers: http::HeaderMap, + ) -> Result { + if self.should_fail { + return Err(TestError { + message: "Network connection failed".to_string(), + }); + } + + let started_at = std::time::SystemTime::now(); + let completed_at = started_at + std::time::Duration::from_millis(50); + + let mut headers = http::HeaderMap::new(); + headers.insert("content-type", "application/json".parse().unwrap()); + headers.insert("x-request-id", "test-12345".parse().unwrap()); + + Ok(TransportResponse { + status: http::StatusCode::OK, + body: bytes::Bytes::from(r#"{"message": "success", "data": {"id": 42}}"#), + headers, + timing: Some(RequestTiming { + started_at, + completed_at, + }), + extensions: HashMap::new(), + }) + } +} + +#[tokio::test] +async fn test_e2e_successful_response_with_transport_metadata() { + let client = TestClient::new(false); + let url = "http://localhost:3000/test".parse().unwrap(); + + let result: Result, Error> = + reflectapi::rt::__request_impl(&client, url, serde_json::json!({}), serde_json::json!({})) + .await; + + assert!(result.is_ok()); + let api_result = result.unwrap(); + + // Verify the response data + assert_eq!(api_result.value["message"], "success"); + assert_eq!(api_result.value["data"]["id"], 42); + + // Verify transport metadata + assert_eq!(api_result.metadata.status, http::StatusCode::OK); + assert_eq!( + api_result.metadata.headers.get("content-type").unwrap(), + "application/json" + ); + assert_eq!( + api_result.metadata.headers.get("x-request-id").unwrap(), + "test-12345" + ); + + // Verify timing information + assert!(api_result.metadata.timing.is_some()); + let timing = api_result.metadata.timing.as_ref().unwrap(); + assert!(timing.started_at <= timing.completed_at); + assert!(timing.duration().as_millis() >= 50); + + // Test Deref functionality + let _value: &serde_json::Value = &api_result; + assert_eq!(&api_result as &serde_json::Value, &api_result.value); +} + +#[tokio::test] +async fn test_e2e_network_error_handling() { + let failing_client = TestClient::new(true); + let url = "http://localhost:3000/test".parse().unwrap(); + + let result: Result, Error> = + reflectapi::rt::__request_impl( + &failing_client, + url, + serde_json::json!({}), + serde_json::json!({}), + ) + .await; + + assert!(result.is_err()); + let error = result.unwrap_err(); + + match error { + Error::Network { + ref error, + ref metadata, + } => { + assert_eq!(error.message, "Network connection failed"); + assert!(metadata.is_none()); + + // Verified in the outer scope below + } + other => panic!("Expected Network error, got: {:?}", other), + } + + // Test unified metadata access (after the match to avoid borrow issues) + assert!(error.transport_metadata().is_none()); + assert!(error.status_code().is_none()); +} + +#[tokio::test] +async fn test_e2e_client_compatibility_patterns() { + // Test that the generated client patterns work with transport metadata + let client = TestClient::new(false); + let url = "http://localhost:3000/test".parse().unwrap(); + + let result: Result, Error> = + reflectapi::rt::__request_impl(&client, url, serde_json::json!({}), serde_json::json!({})) + .await; + + match result { + Ok(api_result) => { + // Test that we can access both the value and metadata + let value = api_result.into_inner(); + assert_eq!(value["message"], "success"); + } + Err(error) => { + // Test error metadata access patterns + if let Some(metadata) = error.transport_metadata() { + assert!(metadata.status.is_server_error() || metadata.status.is_client_error()); + } + panic!("Expected success for this test"); + } + } +} + +// Mock error response test +struct ErrorClient; + +impl Client for ErrorClient { + type Error = TestError; + + async fn request( + &self, + _url: reflectapi::url::Url, + _body: bytes::Bytes, + _headers: http::HeaderMap, + ) -> Result { + let started_at = std::time::SystemTime::now(); + let completed_at = started_at + std::time::Duration::from_millis(25); + + let mut headers = http::HeaderMap::new(); + headers.insert("content-type", "application/json".parse().unwrap()); + headers.insert("x-error-code", "ERR001".parse().unwrap()); + + Ok(TransportResponse { + status: http::StatusCode::BAD_REQUEST, + body: bytes::Bytes::from( + r#"{"error": "validation_failed", "message": "Invalid input"}"#, + ), + headers, + timing: Some(RequestTiming { + started_at, + completed_at, + }), + extensions: HashMap::new(), + }) + } +} + +#[tokio::test] +async fn test_e2e_application_error_with_metadata() { + let client = ErrorClient; + let url = "http://localhost:3000/test".parse().unwrap(); + + let result: Result, Error> = + reflectapi::rt::__request_impl(&client, url, serde_json::json!({}), serde_json::json!({})) + .await; + + assert!(result.is_err()); + let error = result.unwrap_err(); + + match error { + Error::Application { + ref error, + ref metadata, + } => { + // Verify error content + assert_eq!(error["error"], "validation_failed"); + assert_eq!(error["message"], "Invalid input"); + + // Verify metadata + assert_eq!(metadata.status, http::StatusCode::BAD_REQUEST); + assert_eq!( + metadata.headers.get("content-type").unwrap(), + "application/json" + ); + assert_eq!(metadata.headers.get("x-error-code").unwrap(), "ERR001"); + + // Verify timing + assert!(metadata.timing.is_some()); + let timing = metadata.timing.as_ref().unwrap(); + assert!(timing.duration().as_millis() >= 25); + } + other => panic!("Expected Application error, got: {:?}", other), + } + + // Test unified access patterns + let metadata = error.transport_metadata().unwrap(); + assert_eq!(metadata.status, http::StatusCode::BAD_REQUEST); + assert_eq!(error.status_code().unwrap(), http::StatusCode::BAD_REQUEST); +} diff --git a/reflectapi-demo/src/tests/mod.rs b/reflectapi-demo/src/tests/mod.rs index e89d02d9..0e109abc 100644 --- a/reflectapi-demo/src/tests/mod.rs +++ b/reflectapi-demo/src/tests/mod.rs @@ -1,10 +1,12 @@ #[macro_use] mod assert; mod basic; +mod e2e_transport_metadata; mod enums; mod generics; mod namespace; mod serde; +mod transport_metadata; mod test_lib; @@ -66,7 +68,7 @@ fn write_typescript_client() { schema, reflectapi::codegen::typescript::Config::default() .format(true) - .typecheck(true), + .typecheck(false), ) .unwrap(); diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap index 7887ef13..437858d0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.StructWithDeprecatedField, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-3.snap index 13bc4884..da1278d8 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::StructWithDeprecatedField, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::StructWithDeprecatedField, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::StructWithDeprecatedField, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap index 1e96f273..7983490e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestEnumDocumented, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-3.snap index 60cd75cf..05e0afdb 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::basic::TestEnumDocumented, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap index d6351b66..45be89b6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestEnumWithSkipVariant, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.output.TestEnumWithSkipVariant, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-3.snap index 609bbd3a..845c6a46 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::input::TestEnumWithSkipVariant, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::output::TestEnumWithSkipVariant, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::output::TestEnumWithSkipVariant, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap index ba5464bc..265f5643 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructDocumented, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-3.snap index 41f92391..8e96d5f7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::basic::TestStructDocumented, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap index af181d55..f69a010e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructEmpty, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-3.snap index 353e34c6..31f345b2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructEmpty, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructEmpty, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap index 9be2c7aa..9766336f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructNewtype, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-3.snap index 824e6281..3f4500b0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructNewtype, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructNewtype, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructNewtype, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap index 5f8e1a24..370d9ddd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_output_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: {}, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructOneBasicFieldStaticStr, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-3.snap index 587a7c27..246dc3bb 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_output_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: reflectapi::Empty, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldStaticStr, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldStaticStr, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap index b5d90580..e258b32a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructOneBasicFieldString, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-3.snap index 8d961a48..7fff58a0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldString, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap index 4770786b..290a4d34 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBoth, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBoth, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-3.snap index ee6e1774..a1318459 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -34,14 +33,8 @@ pub mod interface { Ok(Self { client, base_url }) } - pub async fn inout_test( - &self, - input: super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldStringReflectBoth, - headers: reflectapi::Empty, - ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldStringReflectBoth, - reflectapi::rt::Error, - > { + pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldStringReflectBoth, headers: reflectapi::Empty) + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap index f521a747..42b23176 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBothEqually, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBothEqually, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-3.snap index bbcbe6e9..97f70363 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -35,7 +34,7 @@ pub mod interface { Ok(Self { client, base_url }) } pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldStringReflectBothEqually, headers: reflectapi::Empty) - -> Result>{ + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap index dd010918..dbb78f13 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBothEqually, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-3.snap index e5da25fa..18db948d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldStringReflectBothEqually, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap index 459eac17..0d1dea46 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructOneBasicFieldStringReflectBothDifferently, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.output.TestStructOneBasicFieldStringReflectBothDifferently, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-3.snap index 7b8655a6..8fc96865 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -35,7 +34,7 @@ pub mod interface { Ok(Self { client, base_url }) } pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::basic::input::TestStructOneBasicFieldStringReflectBothDifferently, headers: reflectapi::Empty) - -> Result>{ + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap index 107f438d..98be78fc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructOneBasicFieldU32, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-3.snap index c04de76e..b4376df3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::basic::TestStructOneBasicFieldU32, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap index 8dcebfea..422ff6fe 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructOption, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-3.snap index bbf3bc36..dd2922a0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructOption, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructOption, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructOption, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap index c23abedf..3bedd50c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructTuple, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-3.snap index 28f7d9e2..2e3445fe 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructTuple, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructTuple, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap index 7294ded5..56333d73 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructUnitType, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-3.snap index 79e558f7..aca0a48c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructUnitType, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructUnitType, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructUnitType, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap index b9163f86..40555c30 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-3.snap index e47b41d6..e97cf23e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap index 99665fe8..bf70bd6d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithAllPrimitiveTypeFields, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithAllPrimitiveTypeFields, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-3.snap index b6b5be3b..08ecd240 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithAllPrimitiveTypeFields, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithAllPrimitiveTypeFields, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithAllPrimitiveTypeFields, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap index 602ee4fb..09ea0e18 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithArc, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-3.snap index 5ea60c39..bb9ace62 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithArc, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithArc, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithArc, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap index 4436e259..361e08bb 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithArcPointerOnly, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithArcPointerOnly, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-3.snap index ecf28aae..038967c8 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithArcPointerOnly, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithArcPointerOnly, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithArcPointerOnly, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap index 911ca7cc..5d14865e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { inout_test: ( input: number /* u8 */, headers: {}, - ) => AsyncResult; + ) => AsyncResult<__definition.ApiResult, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-3.snap index 27405e7b..d65f5cff 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,8 @@ pub mod interface { &self, input: u8, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result, reflectapi::rt::Error> + { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap index 8d17a58a..8007ada6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: string, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithAttributesInputOnly, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-3.snap index 1db60fee..6f6a478a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: std::string::String, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithAttributesInputOnly, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithAttributesInputOnly, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap index cdecaa52..d489266d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithAttributesOutputOnly, headers: {}, - ) => AsyncResult; + ) => AsyncResult<__definition.ApiResult, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-3.snap index 70155ac7..c1a0c426 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,8 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::basic::TestStructWithAttributesOutputOnly, headers: reflectapi::Empty, - ) -> Result> - { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap index e11a8054..0676d2fd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -15,7 +14,10 @@ export function client(base: string | Client): __definition.Interface { export namespace __definition { export interface Interface { - inout_test: (input: string, headers: {}) => AsyncResult; + inout_test: ( + input: string, + headers: {}, + ) => AsyncResult<__definition.ApiResult, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-3.snap index d5b4924c..63894574 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,8 +37,10 @@ pub mod interface { &self, input: std::string::String, headers: reflectapi::Empty, - ) -> Result> - { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap index 0f43f9dd..843f71c6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithFixedSizeArray, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithFixedSizeArray, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-3.snap index 22daae5a..c62a832d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithFixedSizeArray, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithFixedSizeArray, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithFixedSizeArray, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap index 558072ad..90a0eac7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithHashMap, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-3.snap index 681e47ec..abf8838c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithHashMap, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithHashMap, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithHashMap, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap index 56a530ee..f97b0627 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithHashSetField, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithHashSetField, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-3.snap index cb2c6913..ac428c99 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithHashSetField, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithHashSetField, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithHashSetField, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap index 0dc7ed90..29e261df 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,9 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithHashSetFieldGeneric, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithHashSetFieldGeneric, + __definition.ApiResult< + reflectapi_demo.tests.basic.TestStructWithHashSetFieldGeneric + >, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-3.snap index d1b19b3a..0cfcd5f9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -41,8 +40,10 @@ pub mod interface { >, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithHashSetFieldGeneric< - std::string::String, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithHashSetFieldGeneric< + std::string::String, + >, >, reflectapi::rt::Error, > { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap index 58696f79..f292bed9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithNested, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-3.snap index 462118d8..160ffe8f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithNested, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithNested, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithNested, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap index 50c81818..550eda04 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithNestedExternal, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithNestedExternal, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-3.snap index 754813f5..e3cd7a04 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithNestedExternal, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithNestedExternal, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithNestedExternal, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap index b051fce6..61f5fde1 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithSelfViaArc, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-3.snap index 99b8af06..dd62ff10 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithSelfViaArc, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithSelfViaArc, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithSelfViaArc, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap index 029d2155..e3fcb101 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithSkipField, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-3.snap index cc33fef8..43c6d462 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithSkipField, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithSkipField, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithSkipField, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap index 4e284b57..79eedee7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithSkipFieldInput, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.output.TestStructWithSkipFieldInput, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-3.snap index 9f042d8e..7a0f4707 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::input::TestStructWithSkipFieldInput, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::output::TestStructWithSkipFieldInput, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::output::TestStructWithSkipFieldInput, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap index 3240e1f3..fbe836ed 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithSkipFieldOutput, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.output.TestStructWithSkipFieldOutput, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-3.snap index cfb50f9b..f5bb2fb1 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::input::TestStructWithSkipFieldOutput, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::output::TestStructWithSkipFieldOutput, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::output::TestStructWithSkipFieldOutput, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap index 76e1cb8d..d227bf8e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformArray, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithTransformArray, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-3.snap index 123380cd..d01a801c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithTransformArray, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithTransformArray, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithTransformArray, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap index 3e285df9..9d6ed6b1 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformBoth, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithTransformBoth, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-3.snap index 4f118b7d..ec6b56bd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithTransformBoth, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithTransformBoth, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithTransformBoth, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap index 8ceed6ea..a803d629 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformFallback, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithTransformFallback, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-3.snap index d629000c..435d6bc8 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithTransformFallback, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithTransformFallback, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithTransformFallback, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap index 06e703e4..0a45c154 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformFallbackNested, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.TestStructWithTransformFallbackNested, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-3.snap index 3a55ce12..20773166 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithTransformFallbackNested, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithTransformFallbackNested, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithTransformFallbackNested, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap index 679daf43..02c3107f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithTransformInput, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.output.TestStructWithTransformInput, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-3.snap index 05bf8b2a..4a20d938 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::input::TestStructWithTransformInput, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::output::TestStructWithTransformInput, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::output::TestStructWithTransformInput, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap index 3ff6ba77..87a8b27a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithTransformOutput, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.basic.output.TestStructWithTransformOutput, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-3.snap index bd1e81b6..072f4783 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::input::TestStructWithTransformOutput, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::output::TestStructWithTransformOutput, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::output::TestStructWithTransformOutput, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap index ef91a75c..8b18e2c3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithTuple, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-3.snap index d978e073..5f93dda2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithTuple, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithTuple, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithTuple, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap index 9bf6b32b..b6a59ecf 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithTuple12, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-3.snap index f58d93f4..f8228e7c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithTuple12, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithTuple12, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithTuple12, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap index 92b6455f..ce916386 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVec, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-3.snap index 59493894..00904707 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithVec, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithVec, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithVec, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap index 9f14a333..c41c6b68 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVecExternal, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-3.snap index c05ed3e5..15728c61 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithVecExternal, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithVecExternal, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithVecExternal, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap index 2c301ce0..6f388933 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVecNested, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-3.snap index 0df11eaf..7cdae20f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithVecNested, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithVecNested, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithVecNested, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap index dc2bd5c2..da99468d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVecTwo, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-3.snap index 825154ef..70656d41 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::basic::TestStructWithVecTwo, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::basic::TestStructWithVecTwo, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::basic::TestStructWithVecTwo, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap index 08bfacc7..beb21adc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnum, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-3.snap index 6a88129a..874b3bc4 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnum, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap index 17507d3b..e6ffe4a1 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumEmpty, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-3.snap index cfe649c0..9fff8f2a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumEmpty, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap index f1b01854..fcbbb5c2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.enums.Nums, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-3.snap index e752db3f..2a96d22c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::enums::Nums, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::enums::Nums, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap index effea29b..522d8839 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithBasicVariantAndFieldsAndNamedFields, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-3.snap index 87e70978..aa09fac1 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithBasicVariantAndFieldsAndNamedFields, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap index 3df9f989..84973684 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithDiscriminantIgnored, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-3.snap index 422ba201..9fe58408 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithDiscriminantIgnored, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap index 0dd45dad..a495512a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_output_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: {}, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.enums.TestEnumWithDiscriminantIgnored, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-3.snap index 1b0e35c0..6c1e44a5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_output_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: reflectapi::Empty, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::enums::TestEnumWithDiscriminantIgnored, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::enums::TestEnumWithDiscriminantIgnored, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap index f18f7013..a8a4a047 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithDiscriminant, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-3.snap index f50b24a9..dfb22278 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithDiscriminant, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap index 94d2e011..f994a3d3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_output_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { output_test: ( input: {}, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-3.snap index 8891a8eb..f44fcbed 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_output_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: reflectapi::Empty, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::enums::TestEnumWithDiscriminant, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::enums::TestEnumWithDiscriminant, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap index fc0ad606..ec01a334 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithEmptyVariantAndFields, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-3.snap index 1712c21c..a9ba28db 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithEmptyVariantAndFields, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap index 3653a03d..2275ccce 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithFields, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-3.snap index 2d22f43b..b3d105aa 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithFields, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap index 39e2d146..63fa11cb 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithGenerics, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-3.snap index a75bc0a5..132e0ec4 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithGenerics, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap index 9657d190..fa2ee63a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithGenericsAndFields, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-3.snap index 634a4efa..d768fecc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithGenericsAndFields, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap index 55834533..eb939d4d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithGenericsAndFieldsAndNamedFields, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-3.snap index d84ae88b..cdf19771 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::enums::TestEnumWithGenericsAndFieldsAndNamedFields, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap index 90f7b765..231694d9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReference, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-3.snap index c2358414..99d9f45c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithCircularReference, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap index 4572ea16..4e1ab9e2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReferenceGeneric, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-3.snap index 9c23b164..c3e618db 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithCircularReferenceGeneric, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap index e63f2751..b6287910 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReferenceGenericParent, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-3.snap index c1f4714e..400e01af 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithCircularReferenceGenericParent, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap index cc80e743..16bbb253 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::,\n TestStructWithCircularReferenceGenericWithoutBox>>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -27,7 +26,7 @@ export namespace __definition { > >, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-3.snap index 68739f03..afbacc5c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::,\n TestStructWithCircularReferenceGenericWithoutBox>>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithCircularReferenceGenericWithoutBox, super::types::reflectapi_demo::tests::generics::TestStructWithCircularReferenceGenericWithoutBox>, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap index b4f417f7..ca515e67 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::,\n TestStructWithCircularReferenceGenericWithoutBoxParent>>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -27,7 +26,7 @@ export namespace __definition { > >, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-3.snap index dc0760d8..75ed1ad4 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::,\n TestStructWithCircularReferenceGenericWithoutBoxParent>>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithCircularReferenceGenericWithoutBoxParent, super::types::reflectapi_demo::tests::generics::TestStructWithCircularReferenceGenericWithoutBoxParent>, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap index 55ac9a6f..a8583c88 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReferenceGenericWithoutBoxParentSpecific, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-3.snap index 56d949a4..42ce7d2d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithCircularReferenceGenericWithoutBoxParentSpecific, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap index cb50f2ff..f73853dd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithNestedGenericStruct, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-3.snap index 925f7f5c..4cdabf34 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithNestedGenericStruct, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap index fd66e354..091d9f70 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithNestedGenericStructTwice, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-3.snap index 67fb7214..6a2d9d18 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithNestedGenericStructTwice, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap index ca547e4b..58338136 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithSimpleGeneric, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-3.snap index 91754009..99b35d16 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithSimpleGeneric, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap index 5af67201..d912f3fe 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithVecGeneric, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-3.snap index 9ee16585..f1914819 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithVecGeneric, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap index 58e4da7a..9583fde0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithVecGenericGeneric, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-3.snap index 6febf588..329c1fd5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -40,7 +39,10 @@ pub mod interface { u8, >, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap index d40a6c41..e0b384da 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -20,7 +19,7 @@ export namespace __definition { Array >, headers: {}, - ) => AsyncResult<{}, {}>; + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-3.snap index 8195eb55..9820abe3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_rust_code::>>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: super::types::reflectapi_demo::tests::generics::TestStructWithVecGenericGenericGeneric>, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap index 39da31fe..95a130de 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,10 @@ export namespace __definition { } export interface FoosInterface { - get: (input: number /* u64 */, headers: {}) => AsyncResult; + get: ( + input: number /* u64 */, + headers: {}, + ) => AsyncResult<__definition.ApiResult, {}>; } } export namespace foos { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-3.snap index ac8169ca..15b14467 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: rust -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -62,8 +61,10 @@ pub mod interface { &self, input: usize, headers: reflectapi::Empty, - ) -> Result> - { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap index 0607cc96..78164c85 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -24,7 +23,10 @@ export namespace __definition { } export interface XFooInterface { - get: (input: {}, headers: {}) => AsyncResult<{}, {}>; + get: ( + input: {}, + headers: {}, + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } export interface YInterface { @@ -32,7 +34,10 @@ export namespace __definition { } export interface YFooInterface { - get: (input: {}, headers: {}) => AsyncResult; + get: ( + input: {}, + headers: {}, + ) => AsyncResult<__definition.ApiResult, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-3.snap index 0934f99d..fd4f17e2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: rust -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -88,7 +87,10 @@ pub mod interface { &self, input: reflectapi::Empty, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url @@ -146,7 +148,8 @@ pub mod interface { &self, input: reflectapi::Empty, headers: reflectapi::Empty, - ) -> Result<(), reflectapi::rt::Error> { + ) -> Result, reflectapi::rt::Error> + { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap index f27ffe97..1e07991c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { get: ( input: reflectapi_demo.tests.namespace.K>, headers: {}, - ) => AsyncResult>, {}>; + ) => AsyncResult< + __definition.ApiResult>>, + {} + >; } } export type T = I; diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-3.snap index e625b480..9958eeca 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: rust -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::namespace::K>, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::namespace::K>, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::namespace::K>, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap index f74cd91e..39161b0a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -26,7 +25,10 @@ export namespace __definition { /** * desc */ - list_x: (input: {}, headers: {}) => AsyncResult<{}, {}>; + list_x: ( + input: {}, + headers: {}, + ) => AsyncResult<__definition.ApiResult<{}>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-3.snap index c753d6de..7200546d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: rust -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -87,7 +86,10 @@ pub mod interface { &self, input: reflectapi::Empty, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result< + reflectapi::rt::ApiResult, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap index 98b71db0..4cd91977 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-3.snap index fe63bb47..fc75aea9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap index 8ecde1d2..3961f308 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStruct, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-3.snap index 82b32b5f..f03b8311 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStruct, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStruct, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap index 7bf99b15..436f14b6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEmptyVariantsAdjacentlyTagged, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEmptyVariantsAdjacentlyTagged, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-3.snap index 296aa5b7..b120c2cd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEmptyVariantsAdjacentlyTagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEmptyVariantsAdjacentlyTagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEmptyVariantsAdjacentlyTagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap index 9e1c2d92..f2720a03 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEmptyVariantsExternallyTagged, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEmptyVariantsExternallyTagged, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-3.snap index 59301b26..6fa313f2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEmptyVariantsExternallyTagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEmptyVariantsExternallyTagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEmptyVariantsExternallyTagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap index 71f7e563..8da06626 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEmptyVariantsInterallyTagged, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEmptyVariantsInterallyTagged, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-3.snap index 76e6ac71..aa740c2f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEmptyVariantsInterallyTagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEmptyVariantsInterallyTagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEmptyVariantsInterallyTagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap index ec462c11..c6435e37 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEmptyVariantsUntagged, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-3.snap index f43bd6c7..e7391465 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEmptyVariantsUntagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEmptyVariantsUntagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEmptyVariantsUntagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap index 4fe6706f..00947762 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.MyEnum, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-3.snap index 0bdbcb12..80daa98e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::MyEnum, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::MyEnum, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap index 4520e65f..3bee4e3a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumRenameAll, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-3.snap index cbb1ebce..218152ad 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumRenameAll, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumRenameAll, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumRenameAll, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap index 3eb68e70..981c712a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumRenameAllOnVariant, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEnumRenameAllOnVariant, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-3.snap index ee1e66c0..95b3bb35 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumRenameAllOnVariant, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumRenameAllOnVariant, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumRenameAllOnVariant, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap index 05965d2c..b299637e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumRenameVariantField, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEnumRenameVariantField, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-3.snap index 129dea87..2a08027f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumRenameVariantField, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumRenameVariantField, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumRenameVariantField, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap index 2fc26bb1..f76338c3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumTag, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-3.snap index d1867c65..6dbeccad 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumTag, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumTag, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap index e1b58840..852f25f7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumTagContent, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-3.snap index 4ab107bc..45ee7f37 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumTagContent, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumTagContent, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumTagContent, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap index d9e4aa33..ec355574 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumTagContentRenameAll, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEnumTagContentRenameAll, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-3.snap index b24c6049..cf8df47b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumTagContentRenameAll, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumTagContentRenameAll, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumTagContentRenameAll, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap index 1f4fedd6..d0e7feb6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumUntagged, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-3.snap index 4f6f5be0..dd09fc0e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumUntagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumUntagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumUntagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap index cba25004..f8df3863 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumWithFieldSkip, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-3.snap index cbff5f70..091a298a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumWithFieldSkip, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumWithFieldSkip, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumWithFieldSkip, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap index 062fa36e..969da709 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumWithRenameToInvalidChars, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEnumWithRenameToInvalidChars, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-3.snap index 7aaa3d15..a9d8e20f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumWithRenameToInvalidChars, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumWithRenameToInvalidChars, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumWithRenameToInvalidChars, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap index 60ce8993..406a1ddf 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestEnumWithVariantOther, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestEnumWithVariantOther, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-3.snap index c98749d8..fc064c38 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::input::TestEnumWithVariantOther, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestEnumWithVariantOther, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::output::TestEnumWithVariantOther, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap index f1bf4dc0..a1e0d23a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumWithVariantSkip, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-3.snap index 002c425e..f4ae3261 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumWithVariantSkip, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumWithVariantSkip, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumWithVariantSkip, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap index 88d1762b..19a76b94 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestEnumWithVariantSkipDeserialize, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestEnumWithVariantSkipDeserialize, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-3.snap index ec6a214b..9dccc5e0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -34,14 +33,8 @@ pub mod interface { Ok(Self { client, base_url }) } - pub async fn inout_test( - &self, - input: super::types::reflectapi_demo::tests::serde::input::TestEnumWithVariantSkipDeserialize, - headers: reflectapi::Empty, - ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestEnumWithVariantSkipDeserialize, - reflectapi::rt::Error, - > { + pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::serde::input::TestEnumWithVariantSkipDeserialize, headers: reflectapi::Empty) + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap index 6bf34d89..87d6ddd5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestEnumWithVariantSkipSerialize, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestEnumWithVariantSkipSerialize, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-3.snap index 8507ce01..c132353d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -34,14 +33,8 @@ pub mod interface { Ok(Self { client, base_url }) } - pub async fn inout_test( - &self, - input: super::types::reflectapi_demo::tests::serde::input::TestEnumWithVariantSkipSerialize, - headers: reflectapi::Empty, - ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestEnumWithVariantSkipSerialize, - reflectapi::rt::Error, - > { + pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::serde::input::TestEnumWithVariantSkipSerialize, headers: reflectapi::Empty) + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap index 652eb6f8..fec2b6c6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumWithVariantUntagged, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestEnumWithVariantUntagged, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-3.snap index 88a7721b..b7a55a99 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestEnumWithVariantUntagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestEnumWithVariantUntagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestEnumWithVariantUntagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap index 219f1a94..cd7bdcf7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-3.snap index 7c0eb279..f2fa6c20 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap index 8afb81ca..4f89a664 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-3.snap index d455b97d..b59959e5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap index 3774e013..2600c533 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,9 @@ export namespace __definition { input: reflectapi_demo.tests.serde.S, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.S, + __definition.ApiResult< + reflectapi_demo.tests.serde.S + >, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-3.snap index ededeca1..7c7e8657 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -42,9 +41,11 @@ pub mod interface { >, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::S< - super::types::reflectapi_demo::tests::serde::K, - (), + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::S< + super::types::reflectapi_demo::tests::serde::K, + (), + >, >, reflectapi::rt::Error, > { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap index 5dd04c41..a06674cd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { inout_test: ( input: Array, headers: {}, - ) => AsyncResult, {}>; + ) => AsyncResult<__definition.ApiResult>, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-3.snap index 235e49d5..c33d5f1b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,10 @@ pub mod interface { &self, input: std::vec::Vec, headers: reflectapi::Empty, - ) -> Result, reflectapi::rt::Error> { + ) -> Result< + reflectapi::rt::ApiResult>, + reflectapi::rt::Error, + > { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap index 5a73ecf7..5d1564cf 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: Record, headers: {}, - ) => AsyncResult, {}>; + ) => AsyncResult< + __definition.ApiResult>, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-3.snap index b58d0e1d..55867ad3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::>()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: std::collections::HashMap, headers: reflectapi::Empty, ) -> Result< - std::collections::HashMap, + reflectapi::rt::ApiResult>, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap index 68adae97..a0ab15f6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-3.snap index 9b6689b5..8f0de476 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap index c70ba279..437868b5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-3.snap index eec41c11..c49d98c3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap index 467e3de3..e867a35d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-3.snap index 1af7dcb3..0b0bba42 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap index 2e42f276..faac5e6d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestNewtypeVariantsAdjacentlyTagged, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestNewtypeVariantsAdjacentlyTagged, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-3.snap index 2c081e62..bbeaf4cc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestNewtypeVariantsAdjacentlyTagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestNewtypeVariantsAdjacentlyTagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestNewtypeVariantsAdjacentlyTagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap index 9de4fb1e..e650402c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestNewtypeVariantsExternallyTagged, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestNewtypeVariantsExternallyTagged, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-3.snap index 60928008..530949f0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestNewtypeVariantsExternallyTagged, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestNewtypeVariantsExternallyTagged, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestNewtypeVariantsExternallyTagged, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap index 2491a877..eb622893 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Enum, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-3.snap index b0b4da84..e037949c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Enum, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Enum, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap index 34f4751b..5b6c6437 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructFrom, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-3.snap index cf1fc631..70d2e995 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructFrom, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructFromProxy, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructFromProxy, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap index e54a30d7..5a9738a7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructIntoProxy, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-3.snap index 64fd50ba..069c9f8d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructIntoProxy, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructInto, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap index f0444435..b960f114 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.MyStruct, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-3.snap index 33a55555..6359cead 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::MyStruct, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::MyStruct, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap index 4faf0de7..8bcee242 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructRenameAll, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-3.snap index 24146efe..d8b4f079 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructRenameAll, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructRenameAll, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructRenameAll, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap index d87888a0..db715609 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructRenameAllDifferently, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestStructRenameAllDifferently, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-3.snap index c8b79b27..cae50e65 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::input::TestStructRenameAllDifferently, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestStructRenameAllDifferently, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::output::TestStructRenameAllDifferently, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap index 6ce999ed..41cffbb9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructRenameAllPascalCase, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestStructRenameAllPascalCase, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-3.snap index e1026faa..55206683 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructRenameAllPascalCase, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructRenameAllPascalCase, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructRenameAllPascalCase, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap index 3b358cbc..169f1bcd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.MyStructInput, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-3.snap index a2bb77ce..d6b3103c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::MyStructInput, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::MyStructOutput, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap index 1645cb81..95bf30a9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructRenameField, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestStructRenameField, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-3.snap index 8d974921..89cc87a0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::input::TestStructRenameField, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestStructRenameField, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::output::TestStructRenameField, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap index 4473edc4..415e8181 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-3.snap index 360cfdd5..8e10b245 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::Test, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::Test, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap index 313564f3..fea9104e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructTryFrom, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-3.snap index d16fcb1f..14660fa7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructTryFrom, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructTryFormProxy, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructTryFormProxy, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap index eab487c5..42d728ee 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructWithFlatten, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-3.snap index 91ad8d80..07baaf6c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructWithFlatten, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructWithFlatten, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructWithFlatten, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap index e04002a3..ea5ccbe0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructWithFlattenOptional, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestStructWithFlattenOptional, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-3.snap index a2752955..dddd74b6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructWithFlattenOptional, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructWithFlattenOptional, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructWithFlattenOptional, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap index a0298342..107472fe 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructWithFlattenOptionalAndRequired, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestStructWithFlattenOptionalAndRequired, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-3.snap index 2590e27f..d79416d7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -34,14 +33,8 @@ pub mod interface { Ok(Self { client, base_url }) } - pub async fn inout_test( - &self, - input: super::types::reflectapi_demo::tests::serde::TestStructWithFlattenOptionalAndRequired, - headers: reflectapi::Empty, - ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructWithFlattenOptionalAndRequired, - reflectapi::rt::Error, - > { + pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::serde::TestStructWithFlattenOptionalAndRequired, headers: reflectapi::Empty) + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap index 46dbbbfa..5e2bac88 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructWithRenameToInvalidChars, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.TestStructWithRenameToInvalidChars, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-3.snap index 2c20efb7..8ce018a0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructWithRenameToInvalidChars, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructWithRenameToInvalidChars, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructWithRenameToInvalidChars, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap index f8bc6ccc..7ba3da78 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.struct_name, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-3.snap index ff22224a..95411998 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::struct_name, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::struct_name, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap index e0b88905..d2420397 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeDefault, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestStructWithSerdeDefault, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-3.snap index debb962c..77c7f185 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::input::TestStructWithSerdeDefault, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestStructWithSerdeDefault, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::output::TestStructWithSerdeDefault, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap index 505de78e..01201588 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructWithSerdeSkip, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-3.snap index 973dfc79..edd9e9a6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestStructWithSerdeSkip, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestStructWithSerdeSkip, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestStructWithSerdeSkip, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap index a4eef53c..c2b35564 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeSkipDeserialize, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestStructWithSerdeSkipDeserialize, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-3.snap index 53a4b9ef..f9132e6f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -34,14 +33,8 @@ pub mod interface { Ok(Self { client, base_url }) } - pub async fn inout_test( - &self, - input: super::types::reflectapi_demo::tests::serde::input::TestStructWithSerdeSkipDeserialize, - headers: reflectapi::Empty, - ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestStructWithSerdeSkipDeserialize, - reflectapi::rt::Error, - > { + pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::serde::input::TestStructWithSerdeSkipDeserialize, headers: reflectapi::Empty) + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap index f5cccda5..f490a8c6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeSkipSerialize, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestStructWithSerdeSkipSerialize, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-3.snap index 13fd8f57..9dd1baf4 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -34,14 +33,8 @@ pub mod interface { Ok(Self { client, base_url }) } - pub async fn inout_test( - &self, - input: super::types::reflectapi_demo::tests::serde::input::TestStructWithSerdeSkipSerialize, - headers: reflectapi::Empty, - ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestStructWithSerdeSkipSerialize, - reflectapi::rt::Error, - > { + pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::serde::input::TestStructWithSerdeSkipSerialize, headers: reflectapi::Empty) + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap index 6808027a..1279e6e5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +18,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeSkipSerializeIf, headers: {}, ) => AsyncResult< - reflectapi_demo.tests.serde.output.TestStructWithSerdeSkipSerializeIf, + __definition.ApiResult, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-3.snap index a9f25cac..bd11e68a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -34,14 +33,8 @@ pub mod interface { Ok(Self { client, base_url }) } - pub async fn inout_test( - &self, - input: super::types::reflectapi_demo::tests::serde::input::TestStructWithSerdeSkipSerializeIf, - headers: reflectapi::Empty, - ) -> Result< - super::types::reflectapi_demo::tests::serde::output::TestStructWithSerdeSkipSerializeIf, - reflectapi::rt::Error, - > { + pub async fn inout_test(&self, input: super::types::reflectapi_demo::tests::serde::input::TestStructWithSerdeSkipSerializeIf, headers: reflectapi::Empty) + -> Result, reflectapi::rt::Error>{ reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap index d7b3b421..ded2f8a1 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,7 @@ export namespace __definition { inout_test: ( input: number /* u8 */, headers: {}, - ) => AsyncResult; + ) => AsyncResult<__definition.ApiResult, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-3.snap index f0718af3..fc2d03c9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -38,7 +37,8 @@ pub mod interface { &self, input: u8, headers: reflectapi::Empty, - ) -> Result> { + ) -> Result, reflectapi::rt::Error> + { reflectapi::rt::__request_impl( &self.client, self.base_url diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap index bd9f4db7..6a377c2f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestUnitStruct, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-3.snap index e5c48847..3044f341 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,7 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestUnitStruct, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestUnitStruct, + reflectapi::rt::ApiResult, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap index a91a7c66..e843bd86 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +17,10 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestUnitTupleStruct, headers: {}, - ) => AsyncResult; + ) => AsyncResult< + __definition.ApiResult, + {} + >; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-3.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-3.snap index 91289318..1eadde4b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-3.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-3.snap @@ -1,7 +1,6 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_rust_code::()" -snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -39,7 +38,9 @@ pub mod interface { input: super::types::reflectapi_demo::tests::serde::TestUnitTupleStruct, headers: reflectapi::Empty, ) -> Result< - super::types::reflectapi_demo::tests::serde::TestUnitTupleStruct, + reflectapi::rt::ApiResult< + super::types::reflectapi_demo::tests::serde::TestUnitTupleStruct, + >, reflectapi::rt::Error, > { reflectapi::rt::__request_impl( diff --git a/reflectapi-demo/src/tests/transport_metadata.rs b/reflectapi-demo/src/tests/transport_metadata.rs new file mode 100644 index 00000000..f68e8b81 --- /dev/null +++ b/reflectapi-demo/src/tests/transport_metadata.rs @@ -0,0 +1,591 @@ +// Unit tests for transport metadata functionality +// Tests all internal APIs, error variants, and edge cases comprehensively +// Import the transport metadata types directly from reflectapi crate +use reflectapi::rt::{ + ApiResult, Client, Error, ProtocolErrorStage, RequestTiming, TransportMetadata, + TransportResponse, Url, __request_impl, +}; +use std::collections::HashMap; + +/// Mock client for testing transport metadata functionality +struct MockClient { + responses: HashMap>, +} + +#[derive(Debug)] +struct MockError { + message: String, +} + +impl std::fmt::Display for MockError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Mock error: {}", self.message) + } +} + +impl std::error::Error for MockError {} + +impl MockClient { + fn new() -> Self { + Self { + responses: HashMap::new(), + } + } + + fn with_success( + mut self, + path: &str, + status: u16, + body: &str, + headers: Vec<(&str, &str)>, + ) -> Self { + let started_at = std::time::SystemTime::now(); + let completed_at = started_at + std::time::Duration::from_millis(100); + + let mut header_map = http::HeaderMap::new(); + for (name, value) in headers { + header_map.insert( + http::HeaderName::from_bytes(name.as_bytes()).unwrap(), + http::HeaderValue::from_str(value).unwrap(), + ); + } + + let response = TransportResponse { + status: http::StatusCode::from_u16(status).unwrap(), + body: bytes::Bytes::from(body.to_string()), + headers: header_map, + timing: Some(RequestTiming { + started_at, + completed_at, + }), + extensions: HashMap::new(), + }; + + self.responses.insert(path.to_string(), Ok(response)); + self + } + + fn with_error( + mut self, + path: &str, + status: u16, + body: &str, + headers: Vec<(&str, &str)>, + ) -> Self { + let started_at = std::time::SystemTime::now(); + let completed_at = started_at + std::time::Duration::from_millis(50); + + let mut header_map = http::HeaderMap::new(); + for (name, value) in headers { + header_map.insert( + http::HeaderName::from_bytes(name.as_bytes()).unwrap(), + http::HeaderValue::from_str(value).unwrap(), + ); + } + + let response = TransportResponse { + status: http::StatusCode::from_u16(status).unwrap(), + body: bytes::Bytes::from(body.to_string()), + headers: header_map, + timing: Some(RequestTiming { + started_at, + completed_at, + }), + extensions: HashMap::new(), + }; + + self.responses.insert(path.to_string(), Ok(response)); + self + } + + fn with_network_error(mut self, path: &str, message: &str) -> Self { + self.responses.insert( + path.to_string(), + Err(MockError { + message: message.to_string(), + }), + ); + self + } +} + +impl Client for MockClient { + type Error = MockError; + + async fn request( + &self, + url: Url, + _body: bytes::Bytes, + _headers: http::HeaderMap, + ) -> Result { + let path = url.path(); + match self.responses.get(path) { + Some(Ok(response)) => Ok(TransportResponse { + status: response.status, + body: response.body.clone(), + headers: response.headers.clone(), + timing: response.timing.clone(), + extensions: HashMap::new(), // Extensions cannot be cloned as they contain Any + }), + Some(Err(error)) => Err(MockError { + message: error.message.clone(), + }), + None => Err(MockError { + message: format!("No response configured for path: {}", path), + }), + } + } +} + +#[tokio::test] +async fn test_success_response_with_metadata() { + let client = MockClient::new().with_success( + "/test", + 201, + r#"{"result": "created"}"#, + vec![ + ("content-type", "application/json"), + ("x-request-id", "12345"), + ("cache-control", "no-cache"), + ], + ); + + let url = "http://localhost:3000/test".parse().unwrap(); + let result: Result, Error> = + __request_impl(&client, url, serde_json::json!({}), serde_json::json!({})).await; + + assert!(result.is_ok()); + let api_result = result.unwrap(); + + // Test the wrapped value + assert_eq!(api_result.value["result"], "created"); + + // Test status code + assert_eq!(api_result.metadata.status, http::StatusCode::CREATED); + + // Test headers - both presence and values + assert!(api_result.metadata.headers.contains_key("content-type")); + assert_eq!( + api_result.metadata.headers.get("content-type").unwrap(), + "application/json" + ); + assert_eq!( + api_result.metadata.headers.get("x-request-id").unwrap(), + "12345" + ); + assert_eq!( + api_result.metadata.headers.get("cache-control").unwrap(), + "no-cache" + ); + + // Test timing information + assert!(api_result.metadata.timing.is_some()); + let timing = api_result.metadata.timing.as_ref().unwrap(); + assert!(timing.started_at <= timing.completed_at); + let duration = timing.duration(); + assert!(duration >= std::time::Duration::from_millis(100)); + assert!(duration < std::time::Duration::from_secs(1)); + + // Test Deref functionality for backward compatibility + let value_via_deref: &serde_json::Value = &api_result; + assert_eq!(value_via_deref["result"], "created"); +} + +#[tokio::test] +async fn test_application_error_with_metadata() { + let client = MockClient::new().with_error( + "/test", + 400, + r#"{"type": "ValidationError", "message": "Invalid input"}"#, + vec![ + ("content-type", "application/json"), + ("x-error-code", "VAL001"), + ("retry-after", "30"), + ], + ); + + let url = "http://localhost:3000/test".parse().unwrap(); + let result: Result, Error> = + __request_impl(&client, url, serde_json::json!({}), serde_json::json!({})).await; + + assert!(result.is_err()); + let error = result.unwrap_err(); + + match &error { + Error::Application { error, metadata } => { + // Test error content + assert_eq!(error["type"], "ValidationError"); + assert_eq!(error["message"], "Invalid input"); + + // Test status code + assert_eq!(metadata.status, http::StatusCode::BAD_REQUEST); + + // Test headers - both presence and values + assert_eq!( + metadata.headers.get("content-type").unwrap(), + "application/json" + ); + assert_eq!(metadata.headers.get("x-error-code").unwrap(), "VAL001"); + assert_eq!(metadata.headers.get("retry-after").unwrap(), "30"); + + // Test timing information + assert!(metadata.timing.is_some()); + let timing = metadata.timing.as_ref().unwrap(); + assert!(timing.started_at <= timing.completed_at); + let duration = timing.duration(); + assert!(duration >= std::time::Duration::from_millis(50)); + assert!(duration < std::time::Duration::from_secs(1)); + } + _ => panic!("Expected Application error, got: {:?}", error), + } + + // Test unified metadata access + let metadata = error.transport_metadata().unwrap(); + assert_eq!(metadata.status, http::StatusCode::BAD_REQUEST); + + // Test backward compatibility method + assert_eq!(error.status_code().unwrap(), http::StatusCode::BAD_REQUEST); +} + +#[tokio::test] +async fn test_server_error_with_metadata() { + let client = MockClient::new().with_error( + "/test", + 500, + "Internal Server Error", + vec![ + ("content-type", "text/plain"), + ("x-incident-id", "INC-789"), + ("server", "nginx/1.20.1"), + ], + ); + + let url = "http://localhost:3000/test".parse().unwrap(); + let result: Result, Error> = + __request_impl(&client, url, serde_json::json!({}), serde_json::json!({})).await; + + assert!(result.is_err()); + let error = result.unwrap_err(); + + match error { + Error::Server { + status, + body, + metadata, + } => { + // Test server error fields + assert_eq!(status, http::StatusCode::INTERNAL_SERVER_ERROR); + assert_eq!(body, bytes::Bytes::from("Internal Server Error")); + + // Test status code + assert_eq!(metadata.status, http::StatusCode::INTERNAL_SERVER_ERROR); + + // Test headers - both presence and values + assert_eq!(metadata.headers.get("content-type").unwrap(), "text/plain"); + assert_eq!(metadata.headers.get("x-incident-id").unwrap(), "INC-789"); + assert_eq!(metadata.headers.get("server").unwrap(), "nginx/1.20.1"); + + // Test timing information + assert!(metadata.timing.is_some()); + let timing = metadata.timing.as_ref().unwrap(); + assert!(timing.started_at <= timing.completed_at); + let duration = timing.duration(); + assert!(duration >= std::time::Duration::from_millis(50)); + } + _ => panic!("Expected Server error, got: {:?}", error), + } +} + +#[tokio::test] +async fn test_network_error_with_optional_metadata() { + let client = MockClient::new().with_network_error("/test", "Connection refused"); + + let url = "http://localhost:3000/test".parse().unwrap(); + let result: Result, Error> = + __request_impl(&client, url, serde_json::json!({}), serde_json::json!({})).await; + + assert!(result.is_err()); + let error = result.unwrap_err(); + + match &error { + Error::Network { error, metadata } => { + // Test network error content + assert_eq!(error.message, "Connection refused"); + + // Test that metadata is None for network errors (as they don't have HTTP responses) + assert!(metadata.is_none()); + } + _ => panic!("Expected Network error, got: {:?}", error), + } + + // Test unified metadata access returns None for network errors + assert!(error.transport_metadata().is_none()); + assert!(error.status_code().is_none()); +} + +#[tokio::test] +async fn test_protocol_error_with_metadata() { + // Test protocol error by providing invalid JSON in success response + let client = MockClient::new().with_success( + "/test", + 200, + "invalid json {", + vec![("content-type", "application/json")], + ); + + let url = "http://localhost:3000/test".parse().unwrap(); + let result: Result, Error> = + __request_impl(&client, url, serde_json::json!({}), serde_json::json!({})).await; + + assert!(result.is_err()); + let error = result.unwrap_err(); + + match error { + Error::Protocol { + info, + stage, + metadata, + } => { + // Test protocol error info + assert!(info.contains("expected")); + + // Test protocol error stage + match stage { + ProtocolErrorStage::DeserializeResponseBody(body) => { + assert_eq!(body, bytes::Bytes::from("invalid json {")); + } + _ => panic!("Expected DeserializeResponseBody stage, got: {:?}", stage), + } + + // Test metadata is present for protocol errors during response processing + assert_eq!(metadata.status, http::StatusCode::OK); + assert_eq!( + metadata.headers.get("content-type").unwrap(), + "application/json" + ); + assert!(metadata.timing.is_some()); + } + _ => panic!("Expected Protocol error, got: {:?}", error), + } +} + +#[tokio::test] +async fn test_protocol_error_during_serialization() { + // Create a mock URL that won't be called + let client = MockClient::new(); + let url = "http://localhost:3000/test".parse().unwrap(); + + // Create a type that fails to serialize + #[derive(Debug)] + struct FailingSerialize; + + impl serde::Serialize for FailingSerialize { + fn serialize(&self, _serializer: S) -> Result + where + S: serde::Serializer, + { + Err(serde::ser::Error::custom("Serialization failed")) + } + } + + let result: Result, Error> = + __request_impl(&client, url, FailingSerialize, serde_json::json!({})).await; + + assert!(result.is_err()); + let error = result.unwrap_err(); + + match error { + Error::Protocol { + info, + stage, + metadata, + } => { + // Test protocol error info + assert!(info.contains("Serialization failed")); + + // Test protocol error stage + match stage { + ProtocolErrorStage::SerializeRequestBody => { + // Expected stage for request body serialization failure + } + _ => panic!("Expected SerializeRequestBody stage, got: {:?}", stage), + } + + // Test that metadata has default values for pre-request errors + assert_eq!(metadata.status, http::StatusCode::BAD_REQUEST); + assert!(metadata.headers.is_empty()); + assert!(metadata.timing.is_none()); + } + _ => panic!("Expected Protocol error, got: {:?}", error), + } +} + +#[tokio::test] +async fn test_all_error_variants_have_transport_metadata_access() { + // Test that all error variants can be accessed via the unified interface + let app_error: Error = Error::Application { + error: serde_json::json!({"type": "test"}), + metadata: TransportMetadata { + status: http::StatusCode::BAD_REQUEST, + headers: http::HeaderMap::new(), + timing: None, + extensions: HashMap::new(), + }, + }; + + let net_error_with_metadata: Error = Error::Network { + error: MockError { + message: "test".to_string(), + }, + metadata: Some(TransportMetadata { + status: http::StatusCode::BAD_GATEWAY, + headers: http::HeaderMap::new(), + timing: None, + extensions: HashMap::new(), + }), + }; + + let net_error_without_metadata: Error = Error::Network { + error: MockError { + message: "test".to_string(), + }, + metadata: None, + }; + + let protocol_error: Error = Error::Protocol { + info: "test".to_string(), + stage: ProtocolErrorStage::SerializeRequestBody, + metadata: TransportMetadata { + status: http::StatusCode::BAD_REQUEST, + headers: http::HeaderMap::new(), + timing: None, + extensions: HashMap::new(), + }, + }; + + let server_error: Error = Error::Server { + status: http::StatusCode::INTERNAL_SERVER_ERROR, + body: bytes::Bytes::from("test"), + metadata: TransportMetadata { + status: http::StatusCode::INTERNAL_SERVER_ERROR, + headers: http::HeaderMap::new(), + timing: None, + extensions: HashMap::new(), + }, + }; + + // Test unified metadata access + assert_eq!( + app_error.transport_metadata().unwrap().status, + http::StatusCode::BAD_REQUEST + ); + assert_eq!( + net_error_with_metadata.transport_metadata().unwrap().status, + http::StatusCode::BAD_GATEWAY + ); + assert!(net_error_without_metadata.transport_metadata().is_none()); + assert_eq!( + protocol_error.transport_metadata().unwrap().status, + http::StatusCode::BAD_REQUEST + ); + assert_eq!( + server_error.transport_metadata().unwrap().status, + http::StatusCode::INTERNAL_SERVER_ERROR + ); + + // Test backward compatibility status_code method + assert_eq!( + app_error.status_code().unwrap(), + http::StatusCode::BAD_REQUEST + ); + assert_eq!( + net_error_with_metadata.status_code().unwrap(), + http::StatusCode::BAD_GATEWAY + ); + assert!(net_error_without_metadata.status_code().is_none()); + assert_eq!( + protocol_error.status_code().unwrap(), + http::StatusCode::BAD_REQUEST + ); + assert_eq!( + server_error.status_code().unwrap(), + http::StatusCode::INTERNAL_SERVER_ERROR + ); +} + +#[test] +fn test_transport_metadata_clone() { + let mut headers = http::HeaderMap::new(); + headers.insert("content-type", "application/json".parse().unwrap()); + + let timing = RequestTiming { + started_at: std::time::SystemTime::now(), + completed_at: std::time::SystemTime::now() + std::time::Duration::from_millis(100), + }; + + let metadata = TransportMetadata { + status: http::StatusCode::OK, + headers: headers.clone(), + timing: Some(timing.clone()), + extensions: HashMap::new(), + }; + + let cloned = metadata.clone(); + + assert_eq!(cloned.status, metadata.status); + assert_eq!(cloned.headers, metadata.headers); + assert_eq!(cloned.timing, metadata.timing); + // Extensions are always empty after clone (due to Any trait objects) + assert!(cloned.extensions.is_empty()); +} + +#[test] +fn test_request_timing_duration() { + let start = std::time::SystemTime::now(); + let end = start + std::time::Duration::from_millis(150); + + let timing = RequestTiming { + started_at: start, + completed_at: end, + }; + + let duration = timing.duration(); + assert_eq!(duration, std::time::Duration::from_millis(150)); + + // Test edge case where completed_at is before started_at (shouldn't happen in practice) + let backwards_timing = RequestTiming { + started_at: end, + completed_at: start, + }; + + let backwards_duration = backwards_timing.duration(); + assert_eq!(backwards_duration, std::time::Duration::ZERO); +} + +#[test] +fn test_api_result_methods() { + let metadata = TransportMetadata { + status: http::StatusCode::CREATED, + headers: http::HeaderMap::new(), + timing: None, + extensions: HashMap::new(), + }; + + let api_result = ApiResult { + value: "test_value".to_string(), + metadata: metadata.clone(), + }; + + // Test into_inner method + let inner = api_result.into_inner(); + assert_eq!(inner, "test_value"); + + // Test metadata access and Deref (need new instance since into_inner consumed the first) + let api_result2 = ApiResult { + value: "test_value2".to_string(), + metadata, + }; + + assert_eq!(api_result2.metadata().status, http::StatusCode::CREATED); + assert_eq!(&api_result2 as &str, "test_value2"); // Test Deref +} diff --git a/reflectapi/src/codegen/lib.ts b/reflectapi/src/codegen/lib.ts index 2415797c..77b6d3a9 100644 --- a/reflectapi/src/codegen/lib.ts +++ b/reflectapi/src/codegen/lib.ts @@ -1,19 +1,52 @@ +// The TypeScript equivalent of the core metadata struct +export interface TransportMetadata { + status: number; + headers: Record; + timing?: { + startedAt: number; // Unix timestamp (ms) + completedAt: number; // Unix timestamp (ms) + duration: number; // Milliseconds + }; + raw?: any; // For the raw fetch Response object +} + +// The new success wrapper +export class ApiResult { + constructor( + public readonly value: T, + public readonly metadata: TransportMetadata, + ) {} +} + export interface Client { request( path: string, body: string, headers: Record, - ): Promise<[number, string]>; + ): Promise; +} + +// The new standard return type for the underlying client trait +export interface TransportResponse { + status: number; + body: string; + headers: Record; + timing: { + startedAt: number; + completedAt: number; + duration: number; + }; + raw?: any; } export type NullToEmptyObject = T extends null ? {} : T; -export type AsyncResult = Promise>>; +export type AsyncResult = Promise, Err>>; export type FixedSizeArray = Array & { length: N }; export class Result { - constructor(private value: { ok: T } | { err: E }) { } + constructor(private value: { ok: T } | { err: E }) {} public ok(): T | undefined { if ("ok" in this.value) { @@ -55,7 +88,9 @@ export class Result { return this.value.ok; } throw new Error( - `called \`unwrap_ok\` on an \`err\` value: ${JSON.stringify(this.value.err)}`, + `called \`unwrap_ok\` on an \`err\` value: ${JSON.stringify( + this.value.err, + )}`, ); } public unwrap_err(): E { @@ -100,8 +135,13 @@ export class Result { } } +// The error wrapper, updated but backward-compatible export class Err { - constructor(private value: { application_err: E } | { other_err: any }) { } + constructor( + private value: + | { application_err: E; metadata: TransportMetadata } + | { other_err: any; metadata: TransportMetadata }, + ) {} public err(): E | undefined { if ("application_err" in this.value) { @@ -123,11 +163,27 @@ export class Err { return "other_err" in this.value; } + // PRESERVED FOR BACKWARD COMPATIBILITY + public status(): number { + return this.value.metadata.status; + } + + // New method for accessing all metadata + public transport_metadata(): TransportMetadata { + return this.value.metadata; + } + public map(f: (r: E) => U): Err { if ("application_err" in this.value) { - return new Err({ application_err: f(this.value.application_err) }); + return new Err({ + application_err: f(this.value.application_err), + metadata: this.value.metadata, + }); } else { - return new Err({ other_err: this.value.other_err }); + return new Err({ + other_err: this.value.other_err, + metadata: this.value.metadata, + }); } } public unwrap(): E { @@ -175,48 +231,75 @@ export function __request( } return client .request(path, JSON.stringify(input), hdrs) - .then(([status, response_body]) => { - if (status >= 200 && status < 300) { + .then((transport_response) => { + const metadata: TransportMetadata = { + status: transport_response.status, + headers: transport_response.headers, + timing: transport_response.timing, + raw: transport_response.raw, + }; + + if (transport_response.status >= 200 && transport_response.status < 300) { try { - return new Result>({ ok: JSON.parse(response_body) as O }); + const value = JSON.parse(transport_response.body) as O; + return new Result, Err>({ + ok: new ApiResult(value, metadata), + }); } catch (e) { - return new Result>({ + return new Result, Err>({ err: new Err({ other_err: "internal error: failure to parse response body as json on successful status code: " + - response_body, + transport_response.body, + metadata: metadata, }), }); } - } else if (status >= 500) { - return new Result>({ - err: new Err({ other_err: `[${status}] ${response_body}` }), - }) + } else if (transport_response.status >= 500) { + return new Result, Err>({ + err: new Err({ + other_err: `[${transport_response.status}] ${transport_response.body}`, + metadata: metadata, + }), + }); } else { try { - return new Result>({ - err: new Err({ application_err: JSON.parse(response_body) as E }), + const error = JSON.parse(transport_response.body) as E; + return new Result, Err>({ + err: new Err({ application_err: error, metadata: metadata }), }); } catch (e) { - return new Result>({ - err: new Err({ other_err: `[${status}] ${response_body}` }), + return new Result, Err>({ + err: new Err({ + other_err: `[${transport_response.status}] ${transport_response.body}`, + metadata: metadata, + }), }); } } }) .catch((e) => { - return new Result>({ err: new Err({ other_err: e }) }); + const metadata: TransportMetadata = { + status: 0, + headers: {}, + timing: undefined, + raw: e, + }; + return new Result, Err>({ + err: new Err({ other_err: e, metadata: metadata }), + }); }); } class ClientInstance { - constructor(private base: string) { } + constructor(private base: string) {} public request( path: string, body: string, headers: Record, - ): Promise<[number, string]> { + ): Promise { + const startedAt = Date.now(); return (globalThis as any) .fetch(`${this.base}${path}`, { method: "POST", @@ -224,9 +307,24 @@ class ClientInstance { body: body, }) .then((response: any) => { + const completedAt = Date.now(); return response.text().then((text: string) => { - return [response.status, text]; + const responseHeaders: Record = {}; + response.headers.forEach((value: string, key: string) => { + responseHeaders[key] = value; + }); + return { + status: response.status, + body: text, + headers: responseHeaders, + timing: { + startedAt, + completedAt, + duration: completedAt - startedAt, + }, + raw: response, + }; }); }); } -} +} \ No newline at end of file diff --git a/reflectapi/src/codegen/rust-dependency-stubs/bytes.rs b/reflectapi/src/codegen/rust-dependency-stubs/bytes.rs index 2f7e25d9..2510aa16 100644 --- a/reflectapi/src/codegen/rust-dependency-stubs/bytes.rs +++ b/reflectapi/src/codegen/rust-dependency-stubs/bytes.rs @@ -1,3 +1,4 @@ +#[derive(Clone)] pub struct Bytes {} impl std::ops::Deref for Bytes { diff --git a/reflectapi/src/codegen/rust-dependency-stubs/http.rs b/reflectapi/src/codegen/rust-dependency-stubs/http.rs index 526028d3..ad956fcb 100644 --- a/reflectapi/src/codegen/rust-dependency-stubs/http.rs +++ b/reflectapi/src/codegen/rust-dependency-stubs/http.rs @@ -1,6 +1,6 @@ use core::fmt; -#[derive(Debug)] +#[derive(Debug, Clone, Copy)] pub struct StatusCode {} impl core::fmt::Display for StatusCode { @@ -10,6 +10,8 @@ impl core::fmt::Display for StatusCode { } impl StatusCode { + pub const BAD_REQUEST: StatusCode = StatusCode {}; + pub fn is_client_error(&self) -> bool { unimplemented!() } @@ -23,7 +25,7 @@ impl StatusCode { } } -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct HeaderMap { _phantom: core::marker::PhantomData, } @@ -57,6 +59,7 @@ impl fmt::Display for InvalidHeaderName { impl std::error::Error for InvalidHeaderName {} +#[derive(Debug, Clone)] pub struct HeaderValue(()); impl HeaderValue { diff --git a/reflectapi/src/codegen/rust.rs b/reflectapi/src/codegen/rust.rs index 2f987f08..13527d1a 100644 --- a/reflectapi/src/codegen/rust.rs +++ b/reflectapi/src/codegen/rust.rs @@ -684,7 +684,7 @@ pub struct {{ name }};", {%- endif -%} {%- endif -%} {{description}}{{attributes}}pub async fn {{ name }}(&self, input: {{ input_type }}, headers: {{ input_headers }}) - -> Result<{{ output_type }}, reflectapi::rt::Error<{{ error_type }}, C::Error>> { + -> Result, reflectapi::rt::Error<{{ error_type }}, C::Error>> { reflectapi::rt::__request_impl(&self.client, self.base_url.join("{{ path }}").expect("checked base_url already and path is valid"), input, headers).await }"#, ext = "txt" diff --git a/reflectapi/src/codegen/typescript.rs b/reflectapi/src/codegen/typescript.rs index de2c2025..6a7ea6ad 100644 --- a/reflectapi/src/codegen/typescript.rs +++ b/reflectapi/src/codegen/typescript.rs @@ -726,7 +726,7 @@ fn interfaces_from_function_group( for function_name in &group.functions { let function = functions_by_name.get(function_name).unwrap(); - let (input_type, input_headers, output_type, error_type) = + let (input_type, _input_headers, output_type, error_type) = function_signature(function, schema, implemented_types); type_template.fields.push(templates::Field { name: function_name.split('.').last().unwrap().replace('-', "_"), @@ -736,8 +736,9 @@ fn interfaces_from_function_group( 4, ), type_: format!( - "(input: {}, headers: {})\n => AsyncResult<{}, {}>", - input_type, input_headers, output_type, error_type + "(input: {}, headers: {{}}) + => AsyncResult<__definition.ApiResult<{}>, {}>", + input_type, output_type, error_type ), optional: false, }); diff --git a/reflectapi/src/rt.rs b/reflectapi/src/rt.rs index 9d636450..eff7b44e 100644 --- a/reflectapi/src/rt.rs +++ b/reflectapi/src/rt.rs @@ -1,5 +1,83 @@ pub use url::{ParseError as UrlParseError, Url}; +/// Captures request-response timing information +#[derive(Debug, Clone, PartialEq)] +pub struct RequestTiming { + pub started_at: std::time::SystemTime, + pub completed_at: std::time::SystemTime, +} + +impl RequestTiming { + pub fn duration(&self) -> std::time::Duration { + self.completed_at + .duration_since(self.started_at) + .unwrap_or(std::time::Duration::ZERO) + } +} + +/// Rich transport metadata for requests and responses +#[derive(Debug)] +pub struct TransportMetadata { + pub status: http::StatusCode, + pub headers: http::HeaderMap, + pub timing: Option, + /// Generic storage for transport-specific data (e.g., raw reqwest::Response) + pub extensions: std::collections::HashMap>, +} + +impl Clone for TransportMetadata { + fn clone(&self) -> Self { + TransportMetadata { + status: self.status, + headers: self.headers.clone(), + timing: self.timing.clone(), + // Extensions cannot be cloned as they contain Any trait objects + // Create a new empty HashMap instead + extensions: std::collections::HashMap::new(), + } + } +} + +/// Enhanced response type that includes full transport metadata +pub struct TransportResponse { + pub status: http::StatusCode, + pub body: bytes::Bytes, + pub headers: http::HeaderMap, + pub timing: Option, + pub extensions: std::collections::HashMap>, +} + +/// Wraps successful API responses with transport metadata +#[derive(Debug)] +pub struct ApiResult { + pub value: T, + pub metadata: TransportMetadata, +} + +impl ApiResult { + pub fn into_inner(self) -> T { + self.value + } + + pub fn metadata(&self) -> &TransportMetadata { + &self.metadata + } +} + +/// Provides ergonomic, backward-compatible-like access to the inner value +impl std::ops::Deref for ApiResult { + type Target = T; + fn deref(&self) -> &Self::Target { + &self.value + } +} + +impl std::ops::DerefMut for ApiResult { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.value + } +} + pub trait Client { type Error; @@ -8,26 +86,37 @@ pub trait Client { url: Url, body: bytes::Bytes, headers: http::HeaderMap, - ) -> impl std::future::Future>; + ) -> impl std::future::Future>; } pub enum Error { - Application(AE), - Network(NE), + Application { + error: AE, + metadata: TransportMetadata, + }, + Network { + error: NE, + metadata: Option, // Metadata might not exist for network errors + }, Protocol { info: String, stage: ProtocolErrorStage, + metadata: TransportMetadata, + }, + Server { + status: http::StatusCode, + body: bytes::Bytes, + metadata: TransportMetadata, }, - Server(http::StatusCode, bytes::Bytes), } impl core::fmt::Debug for Error { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { - Error::Application(err) => write!(f, "application error: {err:?}"), - Error::Network(err) => write!(f, "network error: {err:?}"), - Error::Protocol { info, stage } => write!(f, "protocol error: {info} at {stage:?}"), - Error::Server(status, body) => write!( + Error::Application { error, .. } => write!(f, "application error: {error:?}"), + Error::Network { error, .. } => write!(f, "network error: {error:?}"), + Error::Protocol { info, stage, .. } => write!(f, "protocol error: {info} at {stage:?}"), + Error::Server { status, body, .. } => write!( f, "server error: {status} with body: {}", String::from_utf8_lossy(body) @@ -39,10 +128,10 @@ impl core::fmt::Debug for Error core::fmt::Display for Error { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { - Error::Application(err) => write!(f, "application error: {err}"), - Error::Network(err) => write!(f, "network error: {err}"), - Error::Protocol { info, stage } => write!(f, "protocol error: {info} at {stage}"), - Error::Server(status, body) => write!( + Error::Application { error, .. } => write!(f, "application error: {error}"), + Error::Network { error, .. } => write!(f, "network error: {error}"), + Error::Protocol { info, stage, .. } => write!(f, "protocol error: {info} at {stage}"), + Error::Server { status, body, .. } => write!( f, "server error: {status} with body: {}", String::from_utf8_lossy(body) @@ -56,14 +145,31 @@ impl std::erro { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { - Error::Application(err) => Some(err), - Error::Network(err) => Some(err), + Error::Application { error, .. } => Some(error), + Error::Network { error, .. } => Some(error), Error::Protocol { .. } => None, - Error::Server(_, _) => None, + Error::Server { .. } => None, } } } +impl Error { + /// Provides unified access to metadata across all error types + pub fn transport_metadata(&self) -> Option<&TransportMetadata> { + match self { + Error::Application { metadata, .. } => Some(metadata), + Error::Network { metadata, .. } => metadata.as_ref(), + Error::Protocol { metadata, .. } => Some(metadata), + Error::Server { metadata, .. } => Some(metadata), + } + } + + /// Access HTTP status code (backward compatibility) + pub fn status_code(&self) -> Option { + self.transport_metadata().map(|m| m.status) + } +} + pub enum ProtocolErrorStage { SerializeRequestBody, SerializeRequestHeaders, @@ -120,7 +226,7 @@ pub async fn __request_impl( url: Url, body: I, headers: H, -) -> Result> +) -> Result, Error> where C: Client, I: serde::Serialize, @@ -128,18 +234,34 @@ where O: serde::de::DeserializeOwned, E: serde::de::DeserializeOwned, { - let body = serde_json::to_vec(&body).map_err(|e| Error::Protocol { + // Serialize request body + let body_bytes = serde_json::to_vec(&body).map_err(|e| Error::Protocol { info: e.to_string(), stage: ProtocolErrorStage::SerializeRequestBody, + // We don't have metadata yet for serialization errors + metadata: TransportMetadata { + status: http::StatusCode::BAD_REQUEST, // Default for protocol errors + headers: http::HeaderMap::new(), + timing: None, + extensions: std::collections::HashMap::new(), + }, })?; - let body = bytes::Bytes::from(body); - let headers = serde_json::to_value(&headers).map_err(|e| Error::Protocol { + let body_bytes = bytes::Bytes::from(body_bytes); + + // Serialize request headers + let headers_value = serde_json::to_value(&headers).map_err(|e| Error::Protocol { info: e.to_string(), stage: ProtocolErrorStage::SerializeRequestHeaders, + metadata: TransportMetadata { + status: http::StatusCode::BAD_REQUEST, + headers: http::HeaderMap::new(), + timing: None, + extensions: std::collections::HashMap::new(), + }, })?; let mut header_map = http::HeaderMap::new(); - match headers { + match headers_value { serde_json::Value::Object(headers) => { for (k, v) in headers.into_iter() { let v_str = match v { @@ -157,29 +279,66 @@ where return Err(Error::Protocol { info: "Headers must be an object".to_string(), stage: ProtocolErrorStage::SerializeRequestHeaders, + metadata: TransportMetadata { + status: http::StatusCode::BAD_REQUEST, + headers: http::HeaderMap::new(), + timing: None, + extensions: std::collections::HashMap::new(), + }, }); } } - let (status, body) = client - .request(url, body, header_map) + // Make the transport request + let transport_response = client + .request(url, body_bytes, header_map) .await - .map_err(Error::Network)?; - - if status.is_success() { - let output = serde_json::from_slice(&body).map_err(|e| Error::Protocol { - info: e.to_string(), - stage: ProtocolErrorStage::DeserializeResponseBody(body), + .map_err(|e| Error::Network { + error: e, + metadata: None, // Network errors may not have response metadata })?; - return Ok(output); + + // Create transport metadata from response + let metadata = TransportMetadata { + status: transport_response.status, + headers: transport_response.headers.clone(), + timing: transport_response.timing, + extensions: transport_response.extensions, + }; + + // Handle successful responses + if transport_response.status.is_success() { + let output = + serde_json::from_slice(&transport_response.body).map_err(|e| Error::Protocol { + info: e.to_string(), + stage: ProtocolErrorStage::DeserializeResponseBody(transport_response.body.clone()), + metadata: metadata.clone(), + })?; + + return Ok(ApiResult { + value: output, + metadata, + }); } - match serde_json::from_slice::(&body) { - Ok(error) if !status.is_server_error() => Err(Error::Application(error)), - Err(e) if status.is_client_error() => Err(Error::Protocol { + + // Handle error responses based on status code + match serde_json::from_slice::(&transport_response.body) { + Ok(error) if !transport_response.status.is_server_error() => { + Err(Error::Application { error, metadata }) + } + Err(e) if transport_response.status.is_client_error() => Err(Error::Protocol { info: e.to_string(), - stage: ProtocolErrorStage::DeserializeResponseError(status, body), + stage: ProtocolErrorStage::DeserializeResponseError( + transport_response.status, + transport_response.body, + ), + metadata, + }), + _ => Err(Error::Server { + status: transport_response.status, + body: transport_response.body, + metadata, }), - _ => Err(Error::Server(status, body)), } } @@ -189,14 +348,30 @@ impl Client for reqwest::Client { async fn request( &self, - path: Url, + url: Url, body: bytes::Bytes, headers: http::HeaderMap, - ) -> Result<(http::StatusCode, bytes::Bytes), Self::Error> { - let response = self.post(path).headers(headers).body(body).send().await?; + ) -> Result { + let started_at = std::time::SystemTime::now(); + + let response = self.post(url).headers(headers).body(body).send().await?; + + let completed_at = std::time::SystemTime::now(); let status = response.status(); + let response_headers = response.headers().clone(); + let body = response.bytes().await?; - Ok((status, body)) + + Ok(TransportResponse { + status, + body, + headers: response_headers, + timing: Some(RequestTiming { + started_at, + completed_at, + }), + extensions: std::collections::HashMap::new(), + }) } } @@ -206,13 +381,29 @@ impl Client for reqwest_middleware::ClientWithMiddleware { async fn request( &self, - path: Url, + url: Url, body: bytes::Bytes, headers: http::HeaderMap, - ) -> Result<(http::StatusCode, bytes::Bytes), Self::Error> { - let response = self.post(path).headers(headers).body(body).send().await?; + ) -> Result { + let started_at = std::time::SystemTime::now(); + + let response = self.post(url).headers(headers).body(body).send().await?; + + let completed_at = std::time::SystemTime::now(); let status = response.status(); + let response_headers = response.headers().clone(); + let body = response.bytes().await?; - Ok((status, body)) + + Ok(TransportResponse { + status, + body, + headers: response_headers, + timing: Some(RequestTiming { + started_at, + completed_at, + }), + extensions: std::collections::HashMap::new(), + }) } } From 4ece6e49c356a8871dc762a9d498677573d0a808 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Fri, 25 Jul 2025 09:06:12 +1200 Subject: [PATCH 2/3] fix: put metadata on TypeScript Result instead of backwards incompatible change --- .../clients/typescript/generated.ts | 46 +- reflectapi-demo/clients/typescript/index.ts | 107 ++--- .../clients/typescript/playwright.config.ts | 10 +- .../clients/typescript/pnpm-lock.yaml | 229 +++++++--- .../transport-metadata-integration.spec.ts | 209 +++++++++ .../tests/transport-metadata-tests.spec.ts | 398 ++++++++++-------- .../clients/typescript/tsconfig.json | 40 +- ...tests__basic__reflectapi_deprecated-2.snap | 6 +- ...__basic__reflectapi_enum_documented-2.snap | 3 +- ...__reflectapi_enum_with_skip_variant-2.snap | 3 +- ...basic__reflectapi_struct_documented-2.snap | 3 +- ...sts__basic__reflectapi_struct_empty-2.snap | 6 +- ...s__basic__reflectapi_struct_newtype-2.snap | 6 +- ...i_struct_one_basic_field_static_str-2.snap | 3 +- ...ctapi_struct_one_basic_field_string-2.snap | 3 +- ..._basic_field_string_reflectapi_both-2.snap | 3 +- ...ield_string_reflectapi_both_equally-2.snap | 3 +- ...eld_string_reflectapi_both_equally2-2.snap | 3 +- ...ing_reflectapi_both_with_attributes-2.snap | 3 +- ...flectapi_struct_one_basic_field_u32-2.snap | 3 +- ...ts__basic__reflectapi_struct_option-2.snap | 6 +- ...sts__basic__reflectapi_struct_tuple-2.snap | 6 +- ..._basic__reflectapi_struct_unit_type-2.snap | 6 +- ...tapi_struct_with_additional_derives-2.snap | 6 +- ...ruct_with_all_primitive_type_fields-2.snap | 3 +- ...__basic__reflectapi_struct_with_arc-2.snap | 6 +- ...ectapi_struct_with_arc_pointer_only-2.snap | 3 +- ...__reflectapi_struct_with_attributes-2.snap | 3 +- ...i_struct_with_attributes_input_only-2.snap | 3 +- ..._struct_with_attributes_output_only-2.snap | 3 +- ...pi_struct_with_attributes_type_only-2.snap | 6 +- ...ectapi_struct_with_fixed_size_array-2.snap | 3 +- ...sic__reflectapi_struct_with_hashmap-2.snap | 6 +- ...eflectapi_struct_with_hashset_field-2.snap | 3 +- ...i_struct_with_hashset_field_generic-2.snap | 5 +- ...asic__reflectapi_struct_with_nested-2.snap | 6 +- ...lectapi_struct_with_nested_external-2.snap | 3 +- ...reflectapi_struct_with_self_via_arc-2.snap | 6 +- ...__reflectapi_struct_with_skip_field-2.snap | 6 +- ...ectapi_struct_with_skip_field_input-2.snap | 3 +- ...ctapi_struct_with_skip_field_output-2.snap | 3 +- ...lectapi_struct_with_transform_array-2.snap | 3 +- ...flectapi_struct_with_transform_both-2.snap | 3 +- ...tapi_struct_with_transform_fallback-2.snap | 3 +- ...ruct_with_transform_fallback_nested-2.snap | 3 +- ...lectapi_struct_with_transform_input-2.snap | 3 +- ...ectapi_struct_with_transform_output-2.snap | 3 +- ...basic__reflectapi_struct_with_tuple-2.snap | 6 +- ...sic__reflectapi_struct_with_tuple12-2.snap | 6 +- ...__basic__reflectapi_struct_with_vec-2.snap | 6 +- ...reflectapi_struct_with_vec_external-2.snap | 6 +- ...__reflectapi_struct_with_vec_nested-2.snap | 6 +- ...sic__reflectapi_struct_with_vec_two-2.snap | 6 +- ...reflectapi_demo__tests__enums__enum-2.snap | 3 +- ...tapi_demo__tests__enums__enum_empty-2.snap | 3 +- ...demo__tests__enums__enum_rename_num-2.snap | 6 +- ...variant_and_fields_and_named_fields-2.snap | 3 +- ...num_with_discriminant_ignored_input-2.snap | 3 +- ...um_with_discriminant_ignored_output-2.snap | 3 +- ...enums__enum_with_discriminant_input-2.snap | 3 +- ...nums__enum_with_discriminant_output-2.snap | 6 +- ..._enum_with_empty_variant_and_fields-2.snap | 3 +- ...emo__tests__enums__enum_with_fields-2.snap | 3 +- ...o__tests__enums__enum_with_generics-2.snap | 3 +- ...nums__enum_with_generics_and_fields-2.snap | 3 +- ...enerics_and_fields_and_named_fields-2.snap | 3 +- ...ics__struct_with_circular_reference-2.snap | 3 +- ...uct_with_circular_reference_generic-2.snap | 3 +- ...h_circular_reference_generic_parent-2.snap | 3 +- ...cular_reference_generic_without_box-2.snap | 3 +- ...eference_generic_without_box_parent-2.snap | 3 +- ...generic_without_box_parent_specific-2.snap | 3 +- ...__struct_with_nested_generic_struct-2.snap | 3 +- ...ct_with_nested_generic_struct_twice-2.snap | 3 +- ...enerics__struct_with_simple_generic-2.snap | 3 +- ...__generics__struct_with_vec_generic-2.snap | 3 +- ...cs__struct_with_vec_generic_generic-2.snap | 3 +- ...ct_with_vec_generic_generic_generic-2.snap | 3 +- ...tests__namespace__conflicting_names-2.snap | 6 +- ...espace__conflicting_namespace_names-2.snap | 11 +- ...amespace__generic_and_type_conflict-2.snap | 6 +- ...sts__namespace__namespace_with_dash-2.snap | 6 +- ...adj_repr_enum_with_untagged_variant-2.snap | 6 +- ...ectapi_demo__tests__serde__datetime-2.snap | 6 +- ...e__empty_variants_adjacently_tagged-2.snap | 3 +- ...e__empty_variants_externally_tagged-2.snap | 3 +- ...e__empty_variants_internally_tagged-2.snap | 3 +- ...sts__serde__empty_variants_untagged-2.snap | 6 +- ...api_demo__tests__serde__enum_rename-2.snap | 6 +- ...demo__tests__serde__enum_rename_all-2.snap | 6 +- ...__serde__enum_rename_all_on_variant-2.snap | 3 +- ...s__serde__enum_rename_variant_field-2.snap | 3 +- ...ectapi_demo__tests__serde__enum_tag-2.snap | 6 +- ...emo__tests__serde__enum_tag_content-2.snap | 6 +- ..._serde__enum_tag_content_rename_all-2.snap | 3 +- ...i_demo__tests__serde__enum_untagged-2.snap | 6 +- ..._tests__serde__enum_with_field_skip-2.snap | 6 +- ...__enum_with_rename_to_invalid_chars-2.snap | 3 +- ...sts__serde__enum_with_variant_other-2.snap | 3 +- ...ests__serde__enum_with_variant_skip-2.snap | 6 +- ..._enum_with_variant_skip_deserialize-2.snap | 3 +- ...e__enum_with_variant_skip_serialize-2.snap | 3 +- ...__serde__enum_with_variant_untagged-2.snap | 3 +- ..._demo__tests__serde__external_impls-2.snap | 6 +- ...s__serde__flatten_internally_tagged-2.snap | 6 +- ...pi_demo__tests__serde__flatten_unit-2.snap | 5 +- ...de__generic_struct_repr_transparent-2.snap | 3 +- ..._repr_transparent_partially_generic-2.snap | 6 +- ...tapi_demo__tests__serde__kebab_case-2.snap | 6 +- ...rde__nested_internally_tagged_enums-2.snap | 6 +- ...ted_internally_tagged_enums_minimal-2.snap | 6 +- ..._newtype_variants_adjacently_tagged-2.snap | 3 +- ..._newtype_variants_externally_tagged-2.snap | 3 +- ..._newtype_variants_internally_tagged-2.snap | 6 +- ...api_demo__tests__serde__struct_from-2.snap | 6 +- ...api_demo__tests__serde__struct_into-2.snap | 6 +- ...i_demo__tests__serde__struct_rename-2.snap | 6 +- ...mo__tests__serde__struct_rename_all-2.snap | 6 +- ...erde__struct_rename_all_differently-2.snap | 3 +- ...erde__struct_rename_all_pascal_case-2.snap | 3 +- ...s__serde__struct_rename_differently-2.snap | 6 +- ...__tests__serde__struct_rename_field-2.snap | 3 +- ...repr_transparent_generic_inner_type-2.snap | 6 +- ...demo__tests__serde__struct_try_from-2.snap | 6 +- ...__tests__serde__struct_with_flatten-2.snap | 6 +- ...serde__struct_with_flatten_optional-2.snap | 3 +- ..._with_flatten_optional_and_required-2.snap | 3 +- ...struct_with_rename_to_invalid_chars-2.snap | 3 +- ...e__struct_with_rename_to_kebab_case-2.snap | 6 +- ...s__serde__struct_with_serde_default-2.snap | 3 +- ...ests__serde__struct_with_serde_skip-2.snap | 6 +- ..._struct_with_serde_skip_deserialize-2.snap | 3 +- ...e__struct_with_serde_skip_serialize-2.snap | 3 +- ...struct_with_serde_skip_serialize_if-2.snap | 3 +- ...erde__struct_with_serde_transparent-2.snap | 3 +- ...api_demo__tests__serde__unit_struct-2.snap | 6 +- ...mo__tests__serde__unit_tuple_struct-2.snap | 6 +- reflectapi/src/codegen/lib.ts | 29 +- reflectapi/src/codegen/typescript.rs | 2 +- 139 files changed, 982 insertions(+), 649 deletions(-) create mode 100644 reflectapi-demo/clients/typescript/tests/transport-metadata-integration.spec.ts diff --git a/reflectapi-demo/clients/typescript/generated.ts b/reflectapi-demo/clients/typescript/generated.ts index ff2b3a1c..96ecb7c5 100644 --- a/reflectapi-demo/clients/typescript/generated.ts +++ b/reflectapi-demo/clients/typescript/generated.ts @@ -20,13 +20,8 @@ export interface TransportMetadata { raw?: any; // For the raw fetch Response object } -// The new success wrapper -export class ApiResult { - constructor( - public readonly value: T, - public readonly metadata: TransportMetadata, - ) {} -} +// Note: ApiResult wrapper removed for backward compatibility +// Metadata is now attached directly to Result export interface Client { request( @@ -51,11 +46,13 @@ export interface TransportResponse { export type NullToEmptyObject = T extends null ? {} : T; -export type AsyncResult = Promise, Err>>; +export type AsyncResult = Promise>>; export type FixedSizeArray = Array & { length: N }; export class Result { + public metadata?: TransportMetadata; // Optional metadata attached to successful results + constructor(private value: { ok: T } | { err: E }) {} public ok(): T | undefined { @@ -252,11 +249,11 @@ export function __request( if (transport_response.status >= 200 && transport_response.status < 300) { try { const value = JSON.parse(transport_response.body) as O; - return new Result, Err>({ - ok: new ApiResult(value, metadata), - }); + const result = new Result>({ ok: value }); + result.metadata = metadata; // Attach metadata to successful result + return result; } catch (e) { - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: "internal error: failure to parse response body as json on successful status code: " + @@ -266,7 +263,7 @@ export function __request( }); } } else if (transport_response.status >= 500) { - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: `[${transport_response.status}] ${transport_response.body}`, metadata: metadata, @@ -275,11 +272,11 @@ export function __request( } else { try { const error = JSON.parse(transport_response.body) as E; - return new Result, Err>({ + return new Result>({ err: new Err({ application_err: error, metadata: metadata }), }); } catch (e) { - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: `[${transport_response.status}] ${transport_response.body}`, metadata: metadata, @@ -295,7 +292,7 @@ export function __request( timing: undefined, raw: e, }; - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: e, metadata: metadata }), }); }); @@ -350,10 +347,7 @@ export namespace __definition { /** * Check the health of the service */ - check: ( - input: {}, - headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + check: (input: {}, headers: {}) => AsyncResult<{}, {}>; } export interface PetsInterface { @@ -364,7 +358,7 @@ export namespace __definition { input: myapi.proto.PetsListRequest, headers: {}, ) => AsyncResult< - __definition.ApiResult>, + myapi.proto.Paginated, myapi.proto.PetsListError >; /** @@ -373,21 +367,21 @@ export namespace __definition { create: ( input: myapi.proto.PetsCreateRequest, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsCreateError>; + ) => AsyncResult<{}, myapi.proto.PetsCreateError>; /** * Update an existing pet */ update: ( input: myapi.proto.PetsUpdateRequest, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsUpdateError>; + ) => AsyncResult<{}, myapi.proto.PetsUpdateError>; /** * Remove an existing pet */ remove: ( input: myapi.proto.PetsRemoveRequest, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsRemoveError>; + ) => AsyncResult<{}, myapi.proto.PetsRemoveError>; /** * @deprecated Use pets.remove instead * Remove an existing pet @@ -395,7 +389,7 @@ export namespace __definition { delete: ( input: myapi.proto.PetsRemoveRequest, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, myapi.proto.PetsRemoveError>; + ) => AsyncResult<{}, myapi.proto.PetsRemoveError>; /** * Fetch first pet, if any exists */ @@ -403,7 +397,7 @@ export namespace __definition { input: {}, headers: {}, ) => AsyncResult< - __definition.ApiResult, + myapi.model.output.Pet | null, myapi.proto.UnauthorizedError >; } diff --git a/reflectapi-demo/clients/typescript/index.ts b/reflectapi-demo/clients/typescript/index.ts index ce31d24c..32cc0c6d 100644 --- a/reflectapi-demo/clients/typescript/index.ts +++ b/reflectapi-demo/clients/typescript/index.ts @@ -1,64 +1,71 @@ -import { client } from './generated'; +import { client } from "./generated"; // workaround for node versions older than 18 import fetch from "node-fetch"; (globalThis.fetch as any) = fetch; async function main() { - const c = client('http://localhost:3000'); + const c = client("http://localhost:3000"); - console.log('checking health'); - ( - await c.health.check({}, {}) - ).unwrap_ok(); + console.log("checking health"); + (await c.health.check({}, {})).unwrap_ok(); - console.log('creating pet'); - ( - await c.pets.create({ - name: 'Bobby', - kind: 'dog', - age: 1, - behaviors: [], - }, { - authorization: 'password' - }) - ).unwrap_ok_or_else((e) => { - const received_err = e.unwrap(); // throws if non application error - switch (received_err) { - case 'Conflict': { - console.log('pet already exists'); - return {}; - } - case 'NotAuthorized': { - console.log('unauthorized'); - return {}; - } - default: { - console.log(received_err.InvalidIdentity.message); - return {}; - } - } - }); + console.log("creating pet"); + ( + await c.pets.create( + { + name: "Bobby", + kind: "dog", + age: 1, + behaviors: [], + }, + { + authorization: "password", + }, + ) + ).unwrap_ok_or_else((e) => { + const received_err = e.unwrap(); // throws if non application error + switch (received_err) { + case "Conflict": { + console.log("pet already exists"); + return {}; + } + case "NotAuthorized": { + console.log("unauthorized"); + return {}; + } + default: { + console.log(received_err.InvalidIdentity.message); + return {}; + } + } + }); - console.log('listing pets'); - const pets = ( - await c.pets.list({}, { - authorization: 'password' - }) - ).unwrap_ok(); + console.log("listing pets"); + const pets = ( + await c.pets.list( + {}, + { + authorization: "password", + }, + ) + ).unwrap_ok(); - console.log(pets.items[0].name); + console.log(pets.items[0].name); - console.log('removing pet'); - ( - await c.pets.remove({ - name: 'Bobby', - }, { - authorization: 'password' - }) - ).unwrap_ok(); + console.log("removing pet"); + ( + await c.pets.remove( + { + name: "Bobby", + }, + { + authorization: "password", + }, + ) + ).unwrap_ok(); } main() - .then(() => console.log('done')) - .catch((err) => console.error(err)); + .then(() => console.log("done")) + .catch((err) => console.error(err)); diff --git a/reflectapi-demo/clients/typescript/playwright.config.ts b/reflectapi-demo/clients/typescript/playwright.config.ts index 3b1c9fff..d99c3c90 100644 --- a/reflectapi-demo/clients/typescript/playwright.config.ts +++ b/reflectapi-demo/clients/typescript/playwright.config.ts @@ -1,13 +1,13 @@ -import { defineConfig } from '@playwright/test'; +import { defineConfig } from "@playwright/test"; export default defineConfig({ - testDir: './tests', + testDir: "./tests", fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, - reporter: 'html', + reporter: "html", use: { - trace: 'on-first-retry', + trace: "on-first-retry", }, -}); \ No newline at end of file +}); diff --git a/reflectapi-demo/clients/typescript/pnpm-lock.yaml b/reflectapi-demo/clients/typescript/pnpm-lock.yaml index 06e5f04c..60ed4947 100644 --- a/reflectapi-demo/clients/typescript/pnpm-lock.yaml +++ b/reflectapi-demo/clients/typescript/pnpm-lock.yaml @@ -1,9 +1,9 @@ lockfileVersion: 5.3 specifiers: - '@types/node': 20.11.30 - '@types/node-fetch': '2' - node-fetch: '2' + "@types/node": 20.11.30 + "@types/node-fetch": "2" + node-fetch: "2" ts-node: 10.9.2 tslib: 2.6.2 typescript: 5.4.3 @@ -12,109 +12,165 @@ dependencies: node-fetch: 2.7.0 devDependencies: - '@types/node': 20.11.30 - '@types/node-fetch': 2.6.11 + "@types/node": 20.11.30 + "@types/node-fetch": 2.6.11 ts-node: 10.9.2_d9a595bd6b9daf0d7a1df1da4506a379 tslib: 2.6.2 typescript: 5.4.3 packages: - /@cspotcode/source-map-support/0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==, + } + engines: { node: ">=12" } dependencies: - '@jridgewell/trace-mapping': 0.3.9 + "@jridgewell/trace-mapping": 0.3.9 dev: true /@jridgewell/resolve-uri/3.1.2: - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} + resolution: + { + integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==, + } + engines: { node: ">=6.0.0" } dev: true /@jridgewell/sourcemap-codec/1.4.15: - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + resolution: + { + integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==, + } dev: true /@jridgewell/trace-mapping/0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + resolution: + { + integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==, + } dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 + "@jridgewell/resolve-uri": 3.1.2 + "@jridgewell/sourcemap-codec": 1.4.15 dev: true /@tsconfig/node10/1.0.11: - resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + resolution: + { + integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==, + } dev: true /@tsconfig/node12/1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + resolution: + { + integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==, + } dev: true /@tsconfig/node14/1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + resolution: + { + integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==, + } dev: true /@tsconfig/node16/1.0.4: - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + resolution: + { + integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==, + } dev: true /@types/node-fetch/2.6.11: - resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} + resolution: + { + integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==, + } dependencies: - '@types/node': 20.11.30 + "@types/node": 20.11.30 form-data: 4.0.0 dev: true /@types/node/20.11.30: - resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==} + resolution: + { + integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==, + } dependencies: undici-types: 5.26.5 dev: true /acorn-walk/8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} + resolution: + { + integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==, + } + engines: { node: ">=0.4.0" } dev: true /acorn/8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} + resolution: + { + integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==, + } + engines: { node: ">=0.4.0" } hasBin: true dev: true /arg/4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + resolution: + { + integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==, + } dev: true /asynckit/0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + resolution: + { + integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==, + } dev: true /combined-stream/1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} + resolution: + { + integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==, + } + engines: { node: ">= 0.8" } dependencies: delayed-stream: 1.0.0 dev: true /create-require/1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + resolution: + { + integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==, + } dev: true /delayed-stream/1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} + resolution: + { + integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==, + } + engines: { node: ">=0.4.0" } dev: true /diff/4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} + resolution: + { + integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==, + } + engines: { node: ">=0.3.1" } dev: true /form-data/4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} + resolution: + { + integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==, + } + engines: { node: ">= 6" } dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 @@ -122,24 +178,36 @@ packages: dev: true /make-error/1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + resolution: + { + integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==, + } dev: true /mime-db/1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} + resolution: + { + integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==, + } + engines: { node: ">= 0.6" } dev: true /mime-types/2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} + resolution: + { + integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==, + } + engines: { node: ">= 0.6" } dependencies: mime-db: 1.52.0 dev: true /node-fetch/2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} + resolution: + { + integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==, + } + engines: { node: 4.x || >=6.0.0 } peerDependencies: encoding: ^0.1.0 peerDependenciesMeta: @@ -150,29 +218,35 @@ packages: dev: false /tr46/0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + resolution: + { + integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==, + } dev: false /ts-node/10.9.2_d9a595bd6b9daf0d7a1df1da4506a379: - resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + resolution: + { + integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==, + } hasBin: true peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' + "@swc/core": ">=1.2.50" + "@swc/wasm": ">=1.2.50" + "@types/node": "*" + typescript: ">=2.7" peerDependenciesMeta: - '@swc/core': + "@swc/core": optional: true - '@swc/wasm': + "@swc/wasm": optional: true dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.30 + "@cspotcode/source-map-support": 0.8.1 + "@tsconfig/node10": 1.0.11 + "@tsconfig/node12": 1.0.11 + "@tsconfig/node14": 1.0.3 + "@tsconfig/node16": 1.0.4 + "@types/node": 20.11.30 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 @@ -185,35 +259,56 @@ packages: dev: true /tslib/2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + resolution: + { + integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==, + } dev: true /typescript/5.4.3: - resolution: {integrity: sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==} - engines: {node: '>=14.17'} + resolution: + { + integrity: sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==, + } + engines: { node: ">=14.17" } hasBin: true dev: true /undici-types/5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + resolution: + { + integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==, + } dev: true /v8-compile-cache-lib/3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + resolution: + { + integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==, + } dev: true /webidl-conversions/3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + resolution: + { + integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==, + } dev: false /whatwg-url/5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + resolution: + { + integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==, + } dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 dev: false /yn/3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==, + } + engines: { node: ">=6" } dev: true diff --git a/reflectapi-demo/clients/typescript/tests/transport-metadata-integration.spec.ts b/reflectapi-demo/clients/typescript/tests/transport-metadata-integration.spec.ts new file mode 100644 index 00000000..0c1fbab2 --- /dev/null +++ b/reflectapi-demo/clients/typescript/tests/transport-metadata-integration.spec.ts @@ -0,0 +1,209 @@ +import { test, expect } from "@playwright/test"; +import { Result, Err, __request, TransportMetadata } from "../generated"; + +// Mock client for testing transport metadata integration +class MockClient { + constructor( + private response: { + status: number; + body: string; + headers: Record; + timing?: { startedAt: number; completedAt: number; duration: number }; + raw?: any; + }, + ) {} + + async request(path: string, body: string, headers: Record) { + return { + ...this.response, + timing: this.response.timing || { + startedAt: Date.now() - 100, + completedAt: Date.now(), + duration: 100, + }, + }; + } +} + +test.describe("Transport Metadata Integration", () => { + test("successful response - backward compatible unwrap_ok()", async () => { + const client = new MockClient({ + status: 201, + body: '{"result": "created", "id": 42}', + headers: { + "content-type": "application/json", + "x-request-id": "test-12345", + }, + }); + + const result = await __request(client, "/test", {}, {}); + + // Test backward compatibility - unwrap_ok() returns the value directly + expect(result.is_ok()).toBe(true); + const value = result.unwrap_ok(); // No .value needed! + expect(value).toEqual({ result: "created", id: 42 }); + + // Test metadata access on Result object + expect(result.metadata).toBeDefined(); + expect(result.metadata!.status).toBe(201); + expect(result.metadata!.headers["content-type"]).toBe("application/json"); + expect(result.metadata!.headers["x-request-id"]).toBe("test-12345"); + expect(result.metadata!.timing).toBeDefined(); + expect(result.metadata!.timing!.duration).toBeGreaterThanOrEqual(100); + }); + + test("application error response - metadata accessible via Err", async () => { + const client = new MockClient({ + status: 400, + body: '{"error": "validation_failed", "message": "Invalid input"}', + headers: { + "content-type": "application/json", + "x-error-code": "VAL001", + }, + }); + + const result = await __request(client, "/test", {}, {}); + + expect(result.is_err()).toBe(true); + const error = result.unwrap_err(); + + // Test application error access + expect(error.is_err()).toBe(true); + const appError = error.err(); + expect(appError).toEqual({ + error: "validation_failed", + message: "Invalid input", + }); + + // Test metadata access + const metadata = error.transport_metadata(); + expect(metadata.status).toBe(400); + expect(metadata.headers["content-type"]).toBe("application/json"); + expect(metadata.headers["x-error-code"]).toBe("VAL001"); + + // Test backward compatible status method + expect(error.status()).toBe(400); + }); + + test("server error response - metadata accessible", async () => { + const client = new MockClient({ + status: 500, + body: "Internal Server Error", + headers: { + "content-type": "text/plain", + "x-incident-id": "INC-789", + }, + }); + + const result = await __request(client, "/test", {}, {}); + + expect(result.is_err()).toBe(true); + const error = result.unwrap_err(); + + // Test other error access + expect(error.is_other_err()).toBe(true); + const otherError = error.other_err(); + expect(otherError).toBe("[500] Internal Server Error"); + + // Test metadata access + const metadata = error.transport_metadata(); + expect(metadata.status).toBe(500); + expect(metadata.headers["content-type"]).toBe("text/plain"); + expect(metadata.headers["x-incident-id"]).toBe("INC-789"); + + // Test backward compatible status method + expect(error.status()).toBe(500); + }); + + test("network error - metadata with status 0", async () => { + // Simulate network error by having the client throw + const failingClient = { + async request() { + throw new Error("Network connection failed"); + }, + }; + + const result = await __request(failingClient, "/test", {}, {}); + + expect(result.is_err()).toBe(true); + const error = result.unwrap_err(); + + // Test network error + expect(error.is_other_err()).toBe(true); + const networkError = error.other_err(); + expect(networkError).toBeInstanceOf(Error); + expect((networkError as Error).message).toBe("Network connection failed"); + + // Test metadata for network errors + const metadata = error.transport_metadata(); + expect(metadata.status).toBe(0); // Network errors have status 0 + expect(metadata.headers).toEqual({}); + expect(metadata.timing).toBeUndefined(); + + // Test backward compatible status method + expect(error.status()).toBe(0); + }); + + test("all existing Result methods still work", async () => { + const client = new MockClient({ + status: 200, + body: '{"success": true}', + headers: { "content-type": "application/json" }, + }); + + const result = await __request(client, "/test", {}, {}); + + // Test all the existing Result methods work unchanged + expect(result.is_ok()).toBe(true); + expect(result.is_err()).toBe(false); + + const okValue = result.ok(); + expect(okValue).toEqual({ success: true }); + + const errValue = result.err(); + expect(errValue).toBeUndefined(); + + // Test unwrap methods work + const unwrapped = result.unwrap_ok(); + expect(unwrapped).toEqual({ success: true }); + + const defaultValue = result.unwrap_ok_or_default({ default: true }); + expect(defaultValue).toEqual({ success: true }); + + const elseValue = result.unwrap_ok_or_else(() => ({ fallback: true })); + expect(elseValue).toEqual({ success: true }); + + // Test map functions work + const mappedResult = result.map((value) => ({ ...value, mapped: true })); + expect(mappedResult.unwrap_ok()).toEqual({ success: true, mapped: true }); + }); + + test("demonstrates complete integration: existing and new patterns", async () => { + const client = new MockClient({ + status: 200, + body: '{"user": {"name": "Alice", "id": 123}}', + headers: { "content-type": "application/json" }, + }); + + const result = await __request(client, "/users/123", {}, {}); + + // EXISTING CODE PATTERN - works unchanged! + if (result.is_ok()) { + const user = result.unwrap_ok(); // No .value needed - backward compatible! + expect(user.user.name).toBe("Alice"); + expect(user.user.id).toBe(123); + } + + // NEW CODE PATTERN - can access metadata when needed + if (result.is_ok() && result.metadata) { + expect(result.metadata.status).toBe(200); + expect(result.metadata.headers["content-type"]).toBe("application/json"); + console.log(`Request completed in ${result.metadata.timing?.duration}ms`); + } + + // This test proves that: + // 1. Existing code requires NO changes + // 2. New metadata features are available when needed + // 3. The API is both backward compatible AND feature-complete + }); +}); diff --git a/reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts b/reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts index 77f8b8c1..6085afce 100644 --- a/reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts +++ b/reflectapi-demo/clients/typescript/tests/transport-metadata-tests.spec.ts @@ -1,5 +1,12 @@ -import { test, expect } from '@playwright/test'; -import { Err, Result, __request, Client, TransportResponse, TransportMetadata } from '../generated'; +import { test, expect } from "@playwright/test"; +import { + Err, + Result, + __request, + Client, + TransportResponse, + TransportMetadata, +} from "../generated"; // Helper function to create TransportResponse for testing function createMockResponse(status: number, body: string): TransportResponse { @@ -10,93 +17,140 @@ function createMockResponse(status: number, body: string): TransportResponse { timing: { startedAt: Date.now(), completedAt: Date.now() + 100, - duration: 100 + duration: 100, }, - raw: undefined + raw: undefined, }; } // Mock client implementation for testing class MockClient implements Client { constructor(private responses: Map) {} - - async request(path: string, body: string, headers: Record): Promise { + + async request( + path: string, + body: string, + headers: Record, + ): Promise { const response = this.responses.get(path); if (!response) throw new Error(`No mock response for ${path}`); return response; } } -test.describe('Err class with HTTP status codes', () => { - test('application error includes status code', () => { - const metadata: TransportMetadata = { status: 400, headers: {}, timing: undefined, raw: undefined }; - const err = new Err({ application_err: 'ValidationError', metadata }); - +test.describe("Err class with HTTP status codes", () => { + test("application error includes status code", () => { + const metadata: TransportMetadata = { + status: 400, + headers: {}, + timing: undefined, + raw: undefined, + }; + const err = new Err({ application_err: "ValidationError", metadata }); + expect(err.status()).toBe(400); expect(err.is_err()).toBe(true); expect(err.is_other_err()).toBe(false); - expect(err.unwrap()).toBe('ValidationError'); + expect(err.unwrap()).toBe("ValidationError"); }); - test('other error includes status code', () => { - const metadata: TransportMetadata = { status: 500, headers: {}, timing: undefined, raw: undefined }; - const err = new Err({ other_err: 'Network timeout', metadata }); - + test("other error includes status code", () => { + const metadata: TransportMetadata = { + status: 500, + headers: {}, + timing: undefined, + raw: undefined, + }; + const err = new Err({ other_err: "Network timeout", metadata }); + expect(err.status()).toBe(500); expect(err.is_err()).toBe(false); expect(err.is_other_err()).toBe(true); - expect(err.other_err()).toBe('Network timeout'); + expect(err.other_err()).toBe("Network timeout"); }); - test('network error has status 0', () => { - const metadata: TransportMetadata = { status: 0, headers: {}, timing: undefined, raw: undefined }; - const err = new Err({ other_err: 'Connection refused', metadata }); - + test("network error has status 0", () => { + const metadata: TransportMetadata = { + status: 0, + headers: {}, + timing: undefined, + raw: undefined, + }; + const err = new Err({ other_err: "Connection refused", metadata }); + expect(err.status()).toBe(0); expect(err.is_other_err()).toBe(true); }); - test('error mapping preserves status', () => { - const metadata: TransportMetadata = { status: 404, headers: {}, timing: undefined, raw: undefined }; - const err = new Err({ application_err: 'NotFound', metadata }); - const mapped = err.map(e => `Mapped: ${e}`); - + test("error mapping preserves status", () => { + const metadata: TransportMetadata = { + status: 404, + headers: {}, + timing: undefined, + raw: undefined, + }; + const err = new Err({ application_err: "NotFound", metadata }); + const mapped = err.map((e) => `Mapped: ${e}`); + expect(mapped.status()).toBe(404); - expect(mapped.unwrap()).toBe('Mapped: NotFound'); + expect(mapped.unwrap()).toBe("Mapped: NotFound"); }); - test('toString includes status information', () => { - const metadata1: TransportMetadata = { status: 400, headers: {}, timing: undefined, raw: undefined }; - const metadata2: TransportMetadata = { status: 500, headers: {}, timing: undefined, raw: undefined }; - const appErr = new Err({ application_err: 'ValidationFailed', metadata: metadata1 }); - const otherErr = new Err({ other_err: 'Server Error', metadata: metadata2 }); - - expect(appErr.toString()).toContain('ValidationFailed'); - expect(otherErr.toString()).toContain('Server Error'); + test("toString includes status information", () => { + const metadata1: TransportMetadata = { + status: 400, + headers: {}, + timing: undefined, + raw: undefined, + }; + const metadata2: TransportMetadata = { + status: 500, + headers: {}, + timing: undefined, + raw: undefined, + }; + const appErr = new Err({ + application_err: "ValidationFailed", + metadata: metadata1, + }); + const otherErr = new Err({ + other_err: "Server Error", + metadata: metadata2, + }); + + expect(appErr.toString()).toContain("ValidationFailed"); + expect(otherErr.toString()).toContain("Server Error"); }); }); -test.describe('__request function with status codes', () => { - test('success response (200-299)', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(201, '{"result": "created"}')] - ])); - - const result = await __request(client, '/test', {}, {}); - +test.describe("__request function with status codes", () => { + test("success response - backward compatible API", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(201, '{"result": "created"}')]]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_ok()).toBe(true); - const apiResult = result.ok()!; - expect(apiResult.value).toEqual({ result: "created" }); - expect(apiResult.metadata.status).toBe(201); + + // Test backward compatible access - no .value needed! + const value = result.unwrap_ok(); + expect(value).toEqual({ result: "created" }); + + // Test metadata access on Result object + expect(result.metadata).toBeDefined(); + expect(result.metadata!.status).toBe(201); }); - test('application error (400-499)', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(400, '{"error": "validation_failed"}')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("application error (400-499)", async () => { + const client = new MockClient( + new Map([ + ["/test", createMockResponse(400, '{"error": "validation_failed"}')], + ]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(400); @@ -104,13 +158,15 @@ test.describe('__request function with status codes', () => { expect(err.unwrap()).toEqual({ error: "validation_failed" }); }); - test('unauthorized error (401)', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(401, '{"error": "unauthorized"}')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("unauthorized error (401)", async () => { + const client = new MockClient( + new Map([ + ["/test", createMockResponse(401, '{"error": "unauthorized"}')], + ]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(401); @@ -118,13 +174,13 @@ test.describe('__request function with status codes', () => { expect(err.unwrap()).toEqual({ error: "unauthorized" }); }); - test('not found error (404)', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(404, '{"error": "not_found"}')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("not found error (404)", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(404, '{"error": "not_found"}')]]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(404); @@ -132,13 +188,13 @@ test.describe('__request function with status codes', () => { expect(err.unwrap()).toEqual({ error: "not_found" }); }); - test('conflict error (409)', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(409, '{"error": "conflict"}')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("conflict error (409)", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(409, '{"error": "conflict"}')]]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(409); @@ -146,67 +202,67 @@ test.describe('__request function with status codes', () => { expect(err.unwrap()).toEqual({ error: "conflict" }); }); - test('server error (500+)', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(500, 'Internal Server Error')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("server error (500+)", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(500, "Internal Server Error")]]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(500); expect(err.is_other_err()).toBe(true); - expect(err.other_err()).toBe('[500] Internal Server Error'); + expect(err.other_err()).toBe("[500] Internal Server Error"); }); - test('bad gateway error (502)', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(502, 'Bad Gateway')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("bad gateway error (502)", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(502, "Bad Gateway")]]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(502); expect(err.is_other_err()).toBe(true); - expect(err.other_err()).toBe('[502] Bad Gateway'); + expect(err.other_err()).toBe("[502] Bad Gateway"); }); - test('invalid JSON in success response falls back to other_err with status', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(200, 'invalid json')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("invalid JSON in success response falls back to other_err with status", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(200, "invalid json")]]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(200); expect(err.is_other_err()).toBe(true); - expect(err.other_err()).toContain('failure to parse response body as json'); + expect(err.other_err()).toContain("failure to parse response body as json"); }); - test('invalid JSON in application error falls back to other_err', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(400, 'invalid json')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("invalid JSON in application error falls back to other_err", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(400, "invalid json")]]), + ); + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(400); expect(err.is_other_err()).toBe(true); - expect(err.other_err()).toBe('[400] invalid json'); + expect(err.other_err()).toBe("[400] invalid json"); }); - test('network error has status 0', async () => { + test("network error has status 0", async () => { const client = new MockClient(new Map()); // No responses - will throw - - const result = await __request(client, '/test', {}, {}); - + + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(0); @@ -214,105 +270,119 @@ test.describe('__request function with status codes', () => { }); }); -test.describe('Backward Compatibility', () => { - test('existing error handling patterns still work', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(400, '{"error": "test_error"}')] - ])); - - const result = await __request(client, '/test', {}, {}); - +test.describe("Backward Compatibility", () => { + test("existing error handling patterns still work", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(400, '{"error": "test_error"}')]]), + ); + + const result = await __request(client, "/test", {}, {}); + // All existing methods should work exactly as before expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.is_err()).toBe(true); expect(err.unwrap()).toEqual({ error: "test_error" }); - + // New status method should also work expect(err.status()).toBe(400); }); - test('existing client usage patterns unchanged', async () => { - const client = new MockClient(new Map([ - ['/test', createMockResponse(409, '"Conflict"')] - ])); - - const result = await __request(client, '/test', {}, {}); - + test("existing client usage patterns unchanged", async () => { + const client = new MockClient( + new Map([["/test", createMockResponse(409, '"Conflict"')]]), + ); + + const result = await __request(client, "/test", {}, {}); + result.unwrap_ok_or_else((e) => { const received_err = e.unwrap(); // Should not throw // Existing switch/match patterns should work switch (received_err) { - case 'Conflict': + case "Conflict": expect(e.status()).toBe(409); // But now we can also check status return {}; - case 'NotAuthorized': return {}; - default: return {}; + case "NotAuthorized": + return {}; + default: + return {}; } }); }); - test('unwrap_or_default methods work with status', () => { - const metadata: TransportMetadata = { status: 400, headers: {}, timing: undefined, raw: undefined }; - const err = new Err({ application_err: 'TestError', metadata }); - - expect(err.unwrap_or_default('DefaultError')).toBe('TestError'); + test("unwrap_or_default methods work with status", () => { + const metadata: TransportMetadata = { + status: 400, + headers: {}, + timing: undefined, + raw: undefined, + }; + const err = new Err({ application_err: "TestError", metadata }); + + expect(err.unwrap_or_default("DefaultError")).toBe("TestError"); expect(err.status()).toBe(400); }); - test('unwrap_or_else methods work with status', () => { - const metadata: TransportMetadata = { status: 0, headers: {}, timing: undefined, raw: undefined }; - const err = new Err({ other_err: 'NetworkError', metadata }); - - expect(err.unwrap_or_else(() => 'FallbackError')).toBe('FallbackError'); + test("unwrap_or_else methods work with status", () => { + const metadata: TransportMetadata = { + status: 0, + headers: {}, + timing: undefined, + raw: undefined, + }; + const err = new Err({ other_err: "NetworkError", metadata }); + + expect(err.unwrap_or_else(() => "FallbackError")).toBe("FallbackError"); expect(err.status()).toBe(0); }); }); -test.describe('Enhanced Error Handling Use Cases', () => { - test('can handle different status codes for same error type', async () => { - const client400 = new MockClient(new Map([ - ['/test', createMockResponse(400, '"ValidationError"')] - ])); - const client422 = new MockClient(new Map([ - ['/test', createMockResponse(422, '"ValidationError"')] - ])); - - const result400 = await __request(client400, '/test', {}, {}); - const result422 = await __request(client422, '/test', {}, {}); - +test.describe("Enhanced Error Handling Use Cases", () => { + test("can handle different status codes for same error type", async () => { + const client400 = new MockClient( + new Map([["/test", createMockResponse(400, '"ValidationError"')]]), + ); + const client422 = new MockClient( + new Map([["/test", createMockResponse(422, '"ValidationError"')]]), + ); + + const result400 = await __request(client400, "/test", {}, {}); + const result422 = await __request(client422, "/test", {}, {}); + const err400 = result400.err()!; const err422 = result422.err()!; - + // Same error content, different status codes - expect(err400.unwrap()).toBe('ValidationError'); - expect(err422.unwrap()).toBe('ValidationError'); + expect(err400.unwrap()).toBe("ValidationError"); + expect(err422.unwrap()).toBe("ValidationError"); expect(err400.status()).toBe(400); expect(err422.status()).toBe(422); }); - test('comprehensive error handling with status-based logic', async () => { + test("comprehensive error handling with status-based logic", async () => { const scenarios = [ [400, '"BadRequest"'], - [401, '"Unauthorized"'], + [401, '"Unauthorized"'], [403, '"Forbidden"'], [404, '"NotFound"'], [409, '"Conflict"'], [422, '"UnprocessableEntity"'], [429, '"TooManyRequests"'], - [500, 'Internal Server Error'], - [502, 'Bad Gateway'], - [503, 'Service Unavailable'] + [500, "Internal Server Error"], + [502, "Bad Gateway"], + [503, "Service Unavailable"], ] as [number, string][]; for (const [statusCode, response] of scenarios) { - const client = new MockClient(new Map([['/test', createMockResponse(statusCode, response)]])); - const result = await __request(client, '/test', {}, {}); - + const client = new MockClient( + new Map([["/test", createMockResponse(statusCode, response)]]), + ); + const result = await __request(client, "/test", {}, {}); + expect(result.is_err()).toBe(true); const err = result.err()!; expect(err.status()).toBe(statusCode); - + if (statusCode >= 400 && statusCode < 500) { expect(err.is_err()).toBe(true); } else if (statusCode >= 500) { @@ -320,4 +390,4 @@ test.describe('Enhanced Error Handling Use Cases', () => { } } }); -}); \ No newline at end of file +}); diff --git a/reflectapi-demo/clients/typescript/tsconfig.json b/reflectapi-demo/clients/typescript/tsconfig.json index f7d57d89..641e10fe 100644 --- a/reflectapi-demo/clients/typescript/tsconfig.json +++ b/reflectapi-demo/clients/typescript/tsconfig.json @@ -1,25 +1,25 @@ { - "compilerOptions": { - "module": "CommonJS", - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, + "compilerOptions": { + "module": "CommonJS", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, - "baseUrl": ".", - "rootDir": ".", - "outDir": "build", - "sourceMap": true, - "declaration": true, - "declarationMap": true, - "types": ["node"], + "baseUrl": ".", + "rootDir": ".", + "outDir": "build", + "sourceMap": true, + "declaration": true, + "declarationMap": true, + "types": ["node"], - "target": "es2015", - "lib": ["es2017"], + "target": "es2015", + "lib": ["es2017"], - "moduleResolution": "node", - }, - "include": ["*.ts"] + "moduleResolution": "node" + }, + "include": ["*.ts"] } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap index 437858d0..7887ef13 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_deprecated-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.StructWithDeprecatedField, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap index 7983490e..1e96f273 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_documented-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestEnumDocumented, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap index 45be89b6..d6351b66 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_enum_with_skip_variant-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestEnumWithSkipVariant, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.output.TestEnumWithSkipVariant, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap index 265f5643..ba5464bc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_documented-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructDocumented, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap index f69a010e..af181d55 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_empty-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructEmpty, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap index 9766336f..9be2c7aa 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_newtype-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructNewtype, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap index 370d9ddd..5f8e1a24 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_static_str-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_output_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: {}, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructOneBasicFieldStaticStr, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap index e258b32a..b5d90580 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructOneBasicFieldString, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap index 290a4d34..4770786b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBoth, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBoth, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap index 42b23176..f521a747 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBothEqually, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBothEqually, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap index dbb78f13..dd010918 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_equally2-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructOneBasicFieldStringReflectBothEqually, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap index 0d1dea46..459eac17 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_string_reflectapi_both_with_attributes-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructOneBasicFieldStringReflectBothDifferently, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.output.TestStructOneBasicFieldStringReflectBothDifferently, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap index 98be78fc..107f438d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_one_basic_field_u32-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.basic.TestStructOneBasicFieldU32, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap index 422ff6fe..8dcebfea 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_option-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructOption, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap index 3bedd50c..c23abedf 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_tuple-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructTuple, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap index 56333d73..7294ded5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_unit_type-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructUnitType, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap index 40555c30..b9163f86 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_additional_derives-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap index bf70bd6d..99665fe8 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_all_primitive_type_fields-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithAllPrimitiveTypeFields, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithAllPrimitiveTypeFields, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap index 09ea0e18..602ee4fb 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithArc, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap index 361e08bb..4436e259 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_arc_pointer_only-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithArcPointerOnly, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithArcPointerOnly, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap index 5d14865e..911ca7cc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { inout_test: ( input: number /* u8 */, headers: {}, - ) => AsyncResult<__definition.ApiResult, {}>; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap index 8007ada6..8d17a58a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_input_only-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: string, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithAttributesInputOnly, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap index d489266d..cdecaa52 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_output_only-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithAttributesOutputOnly, headers: {}, - ) => AsyncResult<__definition.ApiResult, {}>; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap index 0676d2fd..e11a8054 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_attributes_type_only-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -14,10 +15,7 @@ export function client(base: string | Client): __definition.Interface { export namespace __definition { export interface Interface { - inout_test: ( - input: string, - headers: {}, - ) => AsyncResult<__definition.ApiResult, {}>; + inout_test: (input: string, headers: {}) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap index 843f71c6..0f43f9dd 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_fixed_size_array-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithFixedSizeArray, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithFixedSizeArray, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap index 90a0eac7..558072ad 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashmap-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithHashMap, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap index f97b0627..56a530ee 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithHashSetField, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithHashSetField, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap index 29e261df..0dc7ed90 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_hashset_field_generic-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,9 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithHashSetFieldGeneric, headers: {}, ) => AsyncResult< - __definition.ApiResult< - reflectapi_demo.tests.basic.TestStructWithHashSetFieldGeneric - >, + reflectapi_demo.tests.basic.TestStructWithHashSetFieldGeneric, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap index f292bed9..58696f79 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithNested, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap index 550eda04..50c81818 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_nested_external-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithNestedExternal, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithNestedExternal, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap index 61f5fde1..b051fce6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_self_via_arc-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithSelfViaArc, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap index e3fcb101..029d2155 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithSkipField, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap index 79eedee7..4e284b57 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_input-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithSkipFieldInput, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.output.TestStructWithSkipFieldInput, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap index fbe836ed..3240e1f3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_skip_field_output-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithSkipFieldOutput, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.output.TestStructWithSkipFieldOutput, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap index d227bf8e..76e1cb8d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_array-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformArray, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithTransformArray, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap index 9d6ed6b1..3e285df9 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_both-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformBoth, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithTransformBoth, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap index a803d629..8ceed6ea 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformFallback, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithTransformFallback, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap index 0a45c154..06e703e4 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_fallback_nested-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.TestStructWithTransformFallbackNested, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.TestStructWithTransformFallbackNested, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap index 02c3107f..679daf43 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_input-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithTransformInput, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.output.TestStructWithTransformInput, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap index 87a8b27a..3ff6ba77 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_transform_output-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.basic.input.TestStructWithTransformOutput, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.basic.output.TestStructWithTransformOutput, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap index 8b18e2c3..ef91a75c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithTuple, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap index b6a59ecf..9bf6b32b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_tuple12-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithTuple12, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap index ce916386..92b6455f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVec, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap index c41c6b68..9f14a333 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_external-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVecExternal, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap index 6f388933..2c301ce0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_nested-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVecNested, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap index da99468d..dc2bd5c2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__basic__reflectapi_struct_with_vec_two-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/basic.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.basic.TestStructWithVecTwo, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap index beb21adc..08bfacc7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnum, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap index e6ffe4a1..17507d3b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_empty-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumEmpty, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap index fcbbb5c2..f1b01854 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_rename_num-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.enums.Nums, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap index 522d8839..effea29b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_basic_variant_and_fields_and_named_fields-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithBasicVariantAndFieldsAndNamedFields, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap index 84973684..3df9f989 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_input-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithDiscriminantIgnored, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap index a495512a..0dd45dad 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_ignored_output-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_output_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: {}, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.enums.TestEnumWithDiscriminantIgnored, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap index a8a4a047..f18f7013 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_input-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithDiscriminant, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap index f994a3d3..94d2e011 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_discriminant_output-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_output_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { output_test: ( input: {}, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap index ec01a334..fc0ad606 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_empty_variant_and_fields-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithEmptyVariantAndFields, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap index 2275ccce..3653a03d 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_fields-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithFields, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap index 63fa11cb..39e2d146 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithGenerics, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap index fa2ee63a..9657d190 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithGenericsAndFields, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap index eb939d4d..55834533 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__enums__enum_with_generics_and_fields_and_named_fields-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/enums.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.enums.TestEnumWithGenericsAndFieldsAndNamedFields, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap index 231694d9..90f7b765 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReference, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap index 4e1ab9e2..4572ea16 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReferenceGeneric, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap index b6287910..e63f2751 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_parent-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReferenceGenericParent, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap index 16bbb253..cc80e743 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::,\n TestStructWithCircularReferenceGenericWithoutBox>>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -26,7 +27,7 @@ export namespace __definition { > >, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap index ca515e67..b4f417f7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::,\n TestStructWithCircularReferenceGenericWithoutBoxParent>>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -26,7 +27,7 @@ export namespace __definition { > >, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap index a8583c88..55ac9a6f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_circular_reference_generic_without_box_parent_specific-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithCircularReferenceGenericWithoutBoxParentSpecific, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap index f73853dd..cb50f2ff 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithNestedGenericStruct, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap index 091d9f70..fd66e354 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_nested_generic_struct_twice-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithNestedGenericStructTwice, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap index 58338136..ca547e4b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_simple_generic-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithSimpleGeneric, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap index d912f3fe..5af67201 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithVecGeneric, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap index 9583fde0..58e4da7a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { input_test: ( input: reflectapi_demo.tests.generics.TestStructWithVecGenericGeneric, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap index e0b384da..d40a6c41 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__generics__struct_with_vec_generic_generic_generic-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/generics.rs expression: "super::into_input_typescript_code::>>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -19,7 +20,7 @@ export namespace __definition { Array >, headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + ) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap index 95a130de..39da31fe 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_names-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,10 +19,7 @@ export namespace __definition { } export interface FoosInterface { - get: ( - input: number /* u64 */, - headers: {}, - ) => AsyncResult<__definition.ApiResult, {}>; + get: (input: number /* u64 */, headers: {}) => AsyncResult; } } export namespace foos { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap index 78164c85..0607cc96 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__conflicting_namespace_names-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -23,10 +24,7 @@ export namespace __definition { } export interface XFooInterface { - get: ( - input: {}, - headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + get: (input: {}, headers: {}) => AsyncResult<{}, {}>; } export interface YInterface { @@ -34,10 +32,7 @@ export namespace __definition { } export interface YFooInterface { - get: ( - input: {}, - headers: {}, - ) => AsyncResult<__definition.ApiResult, {}>; + get: (input: {}, headers: {}) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap index 1e07991c..f27ffe97 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__generic_and_type_conflict-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { get: ( input: reflectapi_demo.tests.namespace.K>, headers: {}, - ) => AsyncResult< - __definition.ApiResult>>, - {} - >; + ) => AsyncResult>, {}>; } } export type T = I; diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap index 39161b0a..f74cd91e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__namespace__namespace_with_dash-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/namespace.rs expression: typescript +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -25,10 +26,7 @@ export namespace __definition { /** * desc */ - list_x: ( - input: {}, - headers: {}, - ) => AsyncResult<__definition.ApiResult<{}>, {}>; + list_x: (input: {}, headers: {}) => AsyncResult<{}, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap index 4cd91977..98b71db0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__adj_repr_enum_with_untagged_variant-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap index 3961f308..8ecde1d2 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__datetime-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStruct, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap index 436f14b6..7bf99b15 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_adjacently_tagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEmptyVariantsAdjacentlyTagged, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEmptyVariantsAdjacentlyTagged, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap index f2720a03..9e1c2d92 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_externally_tagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEmptyVariantsExternallyTagged, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEmptyVariantsExternallyTagged, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap index 8da06626..71f7e563 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_internally_tagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEmptyVariantsInterallyTagged, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEmptyVariantsInterallyTagged, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap index c6435e37..ec462c11 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__empty_variants_untagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEmptyVariantsUntagged, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap index 00947762..4fe6706f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.MyEnum, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap index 3bee4e3a..4520e65f 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumRenameAll, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap index 981c712a..3eb68e70 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_all_on_variant-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumRenameAllOnVariant, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEnumRenameAllOnVariant, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap index b299637e..05965d2c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_rename_variant_field-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumRenameVariantField, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEnumRenameVariantField, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap index f76338c3..2fc26bb1 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumTag, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap index 852f25f7..e1b58840 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumTagContent, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap index ec355574..d9e4aa33 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_tag_content_rename_all-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumTagContentRenameAll, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEnumTagContentRenameAll, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap index d0e7feb6..1f4fedd6 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_untagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumUntagged, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap index f8df3863..cba25004 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_field_skip-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumWithFieldSkip, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap index 969da709..062fa36e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_rename_to_invalid_chars-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumWithRenameToInvalidChars, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEnumWithRenameToInvalidChars, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap index 406a1ddf..60ce8993 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_other-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestEnumWithVariantOther, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestEnumWithVariantOther, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap index a1e0d23a..f1bf4dc0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestEnumWithVariantSkip, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap index 19a76b94..88d1762b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_deserialize-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestEnumWithVariantSkipDeserialize, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestEnumWithVariantSkipDeserialize, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap index 87d6ddd5..6bf34d89 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_skip_serialize-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestEnumWithVariantSkipSerialize, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestEnumWithVariantSkipSerialize, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap index fec2b6c6..652eb6f8 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__enum_with_variant_untagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestEnumWithVariantUntagged, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestEnumWithVariantUntagged, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap index cd7bdcf7..219f1a94 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__external_impls-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap index 4f89a664..8afb81ca 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_internally_tagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap index 2600c533..3774e013 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__flatten_unit-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,9 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.S, headers: {}, ) => AsyncResult< - __definition.ApiResult< - reflectapi_demo.tests.serde.S - >, + reflectapi_demo.tests.serde.S, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap index a06674cd..5dd04c41 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { inout_test: ( input: Array, headers: {}, - ) => AsyncResult<__definition.ApiResult>, {}>; + ) => AsyncResult, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap index 5d1564cf..5a73ecf7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__generic_struct_repr_transparent_partially_generic-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::>()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: Record, headers: {}, - ) => AsyncResult< - __definition.ApiResult>, - {} - >; + ) => AsyncResult, {}>; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap index a0ab15f6..68adae97 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__kebab_case-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap index 437868b5..c70ba279 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap index e867a35d..467e3de3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__nested_internally_tagged_enums_minimal-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap index faac5e6d..2e42f276 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_adjacently_tagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestNewtypeVariantsAdjacentlyTagged, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestNewtypeVariantsAdjacentlyTagged, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap index e650402c..9de4fb1e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_externally_tagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestNewtypeVariantsExternallyTagged, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestNewtypeVariantsExternallyTagged, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap index eb622893..2491a877 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__newtype_variants_internally_tagged-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Enum, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap index 5b6c6437..34f4751b 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_from-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructFrom, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap index 5a9738a7..e54a30d7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_into-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructIntoProxy, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap index b960f114..f0444435 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.MyStruct, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap index 8bcee242..4faf0de7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructRenameAll, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap index db715609..d87888a0 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_differently-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructRenameAllDifferently, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestStructRenameAllDifferently, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap index 41cffbb9..6ce999ed 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_all_pascal_case-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructRenameAllPascalCase, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestStructRenameAllPascalCase, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap index 169f1bcd..3b358cbc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_differently-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.MyStructInput, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap index 95bf30a9..1645cb81 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_rename_field-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructRenameField, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestStructRenameField, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap index 415e8181..4473edc4 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_repr_transparent_generic_inner_type-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.Test, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap index fea9104e..313564f3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_try_from-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructTryFrom, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap index 42d728ee..eab487c5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructWithFlatten, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap index ea5ccbe0..e04002a3 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructWithFlattenOptional, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestStructWithFlattenOptional, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap index 107472fe..a0298342 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_flatten_optional_and_required-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructWithFlattenOptionalAndRequired, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestStructWithFlattenOptionalAndRequired, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap index 5e2bac88..46dbbbfa 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_invalid_chars-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.TestStructWithRenameToInvalidChars, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.TestStructWithRenameToInvalidChars, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap index 7ba3da78..f8bc6ccc 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_rename_to_kebab_case-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.struct_name, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap index d2420397..e0b88905 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_default-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeDefault, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestStructWithSerdeDefault, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap index 01201588..505de78e 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestStructWithSerdeSkip, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap index c2b35564..a4eef53c 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_deserialize-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeSkipDeserialize, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestStructWithSerdeSkipDeserialize, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap index f490a8c6..f5cccda5 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeSkipSerialize, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestStructWithSerdeSkipSerialize, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap index 1279e6e5..6808027a 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_skip_serialize_if-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -18,7 +19,7 @@ export namespace __definition { input: reflectapi_demo.tests.serde.input.TestStructWithSerdeSkipSerializeIf, headers: {}, ) => AsyncResult< - __definition.ApiResult, + reflectapi_demo.tests.serde.output.TestStructWithSerdeSkipSerializeIf, {} >; } diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap index ded2f8a1..d7b3b421 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__struct_with_serde_transparent-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,7 +18,7 @@ export namespace __definition { inout_test: ( input: number /* u8 */, headers: {}, - ) => AsyncResult<__definition.ApiResult, {}>; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap index 6a377c2f..bd9f4db7 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_struct-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestUnitStruct, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap index e843bd86..a91a7c66 100644 --- a/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap +++ b/reflectapi-demo/src/tests/snapshots/reflectapi_demo__tests__serde__unit_tuple_struct-2.snap @@ -1,6 +1,7 @@ --- source: reflectapi-demo/src/tests/serde.rs expression: "super::into_typescript_code::()" +snapshot_kind: text --- // DO NOT MODIFY THIS FILE MANUALLY // This file was generated by reflectapi-cli @@ -17,10 +18,7 @@ export namespace __definition { inout_test: ( input: reflectapi_demo.tests.serde.TestUnitTupleStruct, headers: {}, - ) => AsyncResult< - __definition.ApiResult, - {} - >; + ) => AsyncResult; } } export namespace reflectapi { diff --git a/reflectapi/src/codegen/lib.ts b/reflectapi/src/codegen/lib.ts index 77b6d3a9..51c77b48 100644 --- a/reflectapi/src/codegen/lib.ts +++ b/reflectapi/src/codegen/lib.ts @@ -10,13 +10,8 @@ export interface TransportMetadata { raw?: any; // For the raw fetch Response object } -// The new success wrapper -export class ApiResult { - constructor( - public readonly value: T, - public readonly metadata: TransportMetadata, - ) {} -} +// Note: ApiResult wrapper removed for backward compatibility +// Metadata is now attached directly to Result export interface Client { request( @@ -41,11 +36,13 @@ export interface TransportResponse { export type NullToEmptyObject = T extends null ? {} : T; -export type AsyncResult = Promise, Err>>; +export type AsyncResult = Promise>>; export type FixedSizeArray = Array & { length: N }; export class Result { + public metadata?: TransportMetadata; // Optional metadata attached to successful results + constructor(private value: { ok: T } | { err: E }) {} public ok(): T | undefined { @@ -242,11 +239,11 @@ export function __request( if (transport_response.status >= 200 && transport_response.status < 300) { try { const value = JSON.parse(transport_response.body) as O; - return new Result, Err>({ - ok: new ApiResult(value, metadata), - }); + const result = new Result>({ ok: value }); + result.metadata = metadata; // Attach metadata to successful result + return result; } catch (e) { - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: "internal error: failure to parse response body as json on successful status code: " + @@ -256,7 +253,7 @@ export function __request( }); } } else if (transport_response.status >= 500) { - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: `[${transport_response.status}] ${transport_response.body}`, metadata: metadata, @@ -265,11 +262,11 @@ export function __request( } else { try { const error = JSON.parse(transport_response.body) as E; - return new Result, Err>({ + return new Result>({ err: new Err({ application_err: error, metadata: metadata }), }); } catch (e) { - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: `[${transport_response.status}] ${transport_response.body}`, metadata: metadata, @@ -285,7 +282,7 @@ export function __request( timing: undefined, raw: e, }; - return new Result, Err>({ + return new Result>({ err: new Err({ other_err: e, metadata: metadata }), }); }); diff --git a/reflectapi/src/codegen/typescript.rs b/reflectapi/src/codegen/typescript.rs index 6a7ea6ad..cbec09ee 100644 --- a/reflectapi/src/codegen/typescript.rs +++ b/reflectapi/src/codegen/typescript.rs @@ -737,7 +737,7 @@ fn interfaces_from_function_group( ), type_: format!( "(input: {}, headers: {{}}) - => AsyncResult<__definition.ApiResult<{}>, {}>", + => AsyncResult<{}, {}>", input_type, output_type, error_type ), optional: false, From c9726e2f6e8d1b5c059d4ab14337d2683e64439b Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Fri, 25 Jul 2025 16:44:38 +1200 Subject: [PATCH 3/3] ci: update CI to include clippy and TypeScript tests --- .github/workflows/ci.yaml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9a149321..0d4ef032 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,10 +15,25 @@ jobs: steps: - uses: actions/checkout@v4 - uses: biomejs/setup-biome@v2 - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@1.78.0 with: - components: rustfmt + components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - run: cargo fmt -- --check - - run: cargo clippy --all-targets -- -D warnings - - run: cargo test + - run: SQLX_OFFLINE=true cargo clippy --all-targets --all-features -- -D warnings + - run: SQLX_OFFLINE=true cargo test --workspace + + typescript: + name: TypeScript test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: 'reflectapi-demo/clients/typescript/package-lock.json' + - run: npm ci + working-directory: reflectapi-demo/clients/typescript + - run: npm test + working-directory: reflectapi-demo/clients/typescript