You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/feature_attempts/hurl.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,22 +7,19 @@ I initially started with the approach of writing my own parser using `petitparse
7
7
Following the maintainer's suggestion, I began developing a wrapper for the Hurl parser using `flutter_rust_bridge`. Since the documentation for the library can be sparse, I’ve documented my steps for clarity:
- I added the library code and the `parse_hurl` function in `rust/src/api/simple.rs`.
18
+
19
19
3.**Generating the Flutter Side Code:**
20
-
20
+
21
21
- I ran:
22
-
23
-
24
-
`flutter_rust_bridge_codegen generate`
25
-
22
+
`flutter_rust_bridge_codegen generate`
26
23
- This generated all the necessary code for Flutter and all the targeted platforms.
27
24
28
25
`flutter_rust_bridge` uses a tool called `cargokit` to manage dependencies, acting as a glue layer between Flutter and Rust. Unfortunately, `cargokit` is still experimental, with little documentation available. The [blog post by Matej Knopp](https://matejknopp.com/post/flutter_plugin_in_rust_with_no_prebuilt_binaries/) provided valuable insights. One crucial takeaway was avoiding the Homebrew installation of Rust and instead using `rustup`. This resolved platform compilation issues for me, though the project is still not compiling entirely.
@@ -31,8 +28,8 @@ Following the maintainer's suggestion, I began developing a wrapper for the Hurl
31
28
32
29
I postponed multi-platform compilation issues to focus on writing the wrapper code. By reviewing the `hurl.dev` documentation and examples, I identified the required structure:
33
30
34
-
-`HurlFile` → List of `Entries`
35
-
-`Entries` → `Request` and `Response`
31
+
-`HurlFile` → List of `Entries`
32
+
-`Entries` → `Request` and `Response`
36
33
37
34
Based on this, I created models in Dart using the `freezed` package. The goal was to convert the JSON output from the Hurl parser into Dart data models. I am confident this part turned out well.
38
35
@@ -63,3 +60,8 @@ At this point, I’ve committed all my code to the repository in a fork. Here ar
63
60
3.**Revisit My Custom Parser**: Complete the parser I started building with `petitparser`.
64
61
65
62
If anyone knows a solution to these challenges or has suggestions, I’d appreciate the help!
63
+
64
+
Current Branches in my fork:
65
+
66
+
-[Hurl Parser with flutter_rust_bridge](https://github.com/WrathOP/apidash/tree/hurl-parser-rust)
67
+
-[Hurl Parser with petiteparser](https://github.com/WrathOP/apidash/tree/hurl-parser-added)
0 commit comments