Fix doctest#4
Merged
Merged
Conversation
This commit addresses numerous issues with the documentation tests (doctests) across the `libft-api` crate, ensuring they are correct, runnable, and pass CI. Key changes include: - Wrapping example code in `async fn` and using a `tokio` runtime to allow `await` syntax in doctests. - Updating API calls in examples to reflect recent changes in request/response structures and function signatures. - Replacing placeholder examples with runnable code snippets. - Improving error handling in tests and examples by using `ClientResult` and the `?` operator instead of `.unwrap()`. - Renaming `TokenError::TempTokenNotFound` to `NoTempToken` for clarity. - Changing the error type of `AuthInfo::build_from_env` to `std::env::VarError`. BREAKING CHANGE: The `AuthInfo::build_from_env` function now returns `Result<AuthInfo, std::env::VarError>` instead of `Result<AuthInfo, String>`. The `TokenError::TempTokenNotFound` enum variant has been renamed to `TokenError::NoTempToken`.
This commit introduces a new binary, `piscine_users`, for fetching users from a specific piscine session at the Gyeongsan campus. The binary parallelizes API requests to efficiently gather user data within a predefined date range and saves the results to a JSON file.
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 pull request refines documentation and adds a new binary to the
libft-apiproject. The main focus is on improving example code snippets throughout the API modules to ensure they are more robust and user-friendly, particularly by updating authentication handling and streamlining test and example code. Additionally, it introduces a new binary for campus user queries and enhances the flexibility of group queries.Documentation and Example Improvements
AuthInfo::build_from_env()?withAuthInfo::build_from_env().unwrap()and updating token retrieval to handle errors more transparently. This makes the examples easier to copy and run, especially for beginners. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]New Features and API Enhancements
piscine_usersto the project for specialized campus user queries, making it easier to run specific user-related tasks from the command line.groupsAPI endpoint to support filtering byuser_id, allowing more flexible group queries and improving test coverage for this feature. [1] [2]Testing and Internal Cleanups
These changes collectively improve the usability and maintainability of the API documentation and codebase, making it easier for new and existing users to get started and for developers to extend functionality.