panghu-huang / octocrate Goto Github PK
View Code? Open in Web Editor NEWA comprehensive GitHub REST API library based on Rust.
License: MIT License
A comprehensive GitHub REST API library based on Rust.
License: MIT License
I'm using this code in a full-stack rust application which is being built using leptos
. For this reason, I would like to share the same model structs between the frontend and backend.
Right now sharing the models and types also includes the octocrate-core
crate which includes dependencies such as jsonwebtoken
and others which would bloat the frontend build.
All the model and webhook structs are using the derived_builder
macro for a builder that implements runtime builder checks.
Have you considered using typed-builder which implements compile time checks without the need for an unwrap()
or runtime checking of the created structs.
I can create a pull request if it would be of interest to you?
Currently, there is no simple way for a contributor to know if their pushes have broken the build without manually running tests locally.
Add some CI actions to ensure the following:
GitHub supports pagination for several of it's apis: https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api?apiVersion=2022-11-28#using-link-headers
I would like to add a paginated_send
method that appears on the Request
struct for all endpoints that return data which implements IntoIterator
.
It extracts the page data from the link header and returns the PaginatedData
struct.
pub struct LinkedPages {
pub previous: Option<i64>,
pub next: Option<i64>,
pub first: Option<i64>,
pub last: Option<i64>,
}
pub struct PaginatedData<Data> {
data: Data,
pages: LinkedPages,
}
I'll push a PR soon.
It doesn't look like there's any reason for them not to be Copy
.
The current version of this repo is a few months behind the currently published version on crates.io. Is it possible to resolve this?
Also, if possible, I'd like to contribute to this library as I will be using it extensively over the next few months.
Currently, dates are deserialized as String
when it would be more convenient for some libraries to deserialize them as DateTime<Utc>
.
Since the chrono
library is already a dependency of the octocrate-core
library, there is no need to hide it behind a feature flag.
old five can also be called jay,six six six...
There are a number of unformatted files in the crate from the GitHub API code generation.
codegen
commandcargo clippy --fix
to fix all issuesWhenever running the cargo codegen
alias, all the generated files are given a completely random order.
It should be possible to order structs, methods and enums in the same order as they appear in their OpenAPI specifications, thus ensuring consistency between each run of the command.
Presently, when Request::send(self)
is called, it just returns the data.
Let's wrap the data in a GitHubResponse
struct for access to some of the metadata around the request.
#[derive(Clone)]
pub struct GithubResponse<Data> {
pub data: Data,
pub headers: HeaderMap,
pub status: StatusCode,
pub version: Version,
pub content_length: Option<u64>,
pub url: Url,
}
This would be a breaking change.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.