Merged
Conversation
Contributor
Author
|
@filfreire Would you be able to review? |
|
This feature is very interesting 😍, thank you @Benjscho for the PR 🙏 ❤️ Does someone know if something is blocking the merge? I can't wait to be able to use it haha 😅 |
Create initial rust files to support the target. Create all of the demo fixture files for the different request types. These also require specific `Cargo.toml` dependencies with some features, but I've tried to keep them fully qualified where possible. I'm not sure yet how best to show adding dependencies to a project to enable these features.
Start working on the reqwest conversion client after adding targets.
Completed adding Rust as a target. All of the fixtures have been tested in a separate Rust project to verify that they build and successfully run against the Har test endpoint. All tests are running and passing, except for the snapshot that verifies all available targets, not sure where to update that.
Ran the linter defined in `package.json` All tests except snapshot for targets passing.
Update the available targets test to fix the snapshot.
filfreire
approved these changes
Jul 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a Rust target using the reqwest library. I know there was another PR (#242) to add this a while back prior to the major refactor, this completes that work with an updated implementation.
For the time being it only supports an async client, but in future that can be updated to support the blocking client later on. It also requires a few additional crates to be added to a
Cargo.tomldependency file when using the generated snippets. In particular:I wasn't sure how best to specify that when generating the snippets, that could be something that's passed in the the client as an option.
Most of this code was based on the Python requests library client, and I borrowed a helper implementation there. That could be generalised too for better use across the library but I just left it with the copied and modified version for now.
Either way it would be great to merge in some Rust client support. Let me know if there are any changes or refactors you'd like! I added a new helper util method to add to the last line edited, specifically so I could add semicolons.
Tested by adding fixtures and running
npm run test, updated availability targets withnpm test -- -u. All tests passing: