Coder Social home page Coder Social logo

octocrate's People

Contributors

dholroyd avatar ifiokjr avatar panghu-huang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

octocrate's Issues

Move `models` and `webhooks` to a seperates types crate

Description

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.

Switch from `derive_builder` to `typed-builder`

Description

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?

Add GitHub actions for linting / testing on `main` and pull requests

Description

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:

  • Code is properly formatted
  • Unit tests pass
  • Example tests pass
  • Documentation examples all pass
  • Docs build correctly

Add support for pagination

Description

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.

Make enum's `Copy`

Description

It doesn't look like there's any reason for them not to be Copy.

Repo does not reflect the published version on crates.io

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.

Deserialize dates to `DateTime<Utc>`

Description

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.

Autofix with `cargo clippy` and `cargo fmt`

Description

There are a number of unformatted files in the crate from the GitHub API code generation.

  • add automatic formatting to the codegen command
  • use cargo clippy --fix to fix all issues
  • regenerate the generated code applying all these changes

`codegen` command ordering is non-deterministic

Description

Whenever 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.

Wrap data in a `GitHubResponse` struct

Description

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.