All Projects → jcabi → Jcabi Github

jcabi / Jcabi Github

Licence: other
Object Oriented Wrapper of Github API

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Jcabi Github

Githubapi
Swift implementation of Github REST API v3
Stars: ✭ 55 (-78.17%)
Mutual labels:  api, rest-api, github-api
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+4119.84%)
Mutual labels:  api, rest-api, sdk
Strapi Sdk Javascript
🔌 Official JavaScript SDK for APIs built with Strapi.
Stars: ✭ 247 (-1.98%)
Mutual labels:  api, rest-api, sdk
Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (-2.38%)
Mutual labels:  api, rest-api
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+945.63%)
Mutual labels:  api, rest-api
Drago
A flexible configuration manager for Wireguard networks
Stars: ✭ 204 (-19.05%)
Mutual labels:  api, rest-api
Jikan Rest
The REST API for Jikan
Stars: ✭ 200 (-20.63%)
Mutual labels:  api, rest-api
Datoji
A tiny JSON storage service. Create, Read, Update, Delete and Search JSON data.
Stars: ✭ 222 (-11.9%)
Mutual labels:  api, rest-api
Symfony Flex Backend
Symfony Flex REST API template project
Stars: ✭ 214 (-15.08%)
Mutual labels:  api, rest-api
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+1021.03%)
Mutual labels:  api, rest-api
Bmw Yolov4 Inference Api Gpu
This is a repository for an nocode object detection inference API using the Yolov3 and Yolov4 Darknet framework.
Stars: ✭ 237 (-5.95%)
Mutual labels:  api, rest-api
Generator Api
🚀 Yeoman generator for creating RESTful NodeJS APIs, using ES6, Mongoose and Express
Stars: ✭ 247 (-1.98%)
Mutual labels:  api, rest-api
Swiftdailyapi
A Swift API framework for ZhiHu's Daily News.
Stars: ✭ 204 (-19.05%)
Mutual labels:  api, rest-api
Magic
Create your .Net Core/Angular/Database CRUD Web apps by simply clicking a button
Stars: ✭ 214 (-15.08%)
Mutual labels:  api, rest-api
Dialetus Service
API to Informal dictionary for the idiomatic expressions that each Brazilian region It has
Stars: ✭ 202 (-19.84%)
Mutual labels:  api, rest-api
Bookmarks.dev
Bookmarks and Code Snippets Manager for Developers & Co
Stars: ✭ 218 (-13.49%)
Mutual labels:  api, rest-api
Rest Api
Learn how to build your own REST API with Python, Django, and the Django Rest Framework.
Stars: ✭ 232 (-7.94%)
Mutual labels:  api, rest-api
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+1268.25%)
Mutual labels:  api, rest-api
Api
API that uncovers the technologies used on websites and generates thumbnail from screenshot of website
Stars: ✭ 189 (-25%)
Mutual labels:  api, rest-api
Co Cart
🛒 CoCart is a flexible, open-source solution to enabling the shopping cart via the REST API for WooCommerce.
Stars: ✭ 198 (-21.43%)
Mutual labels:  api, rest-api

Donate via Zerocracy

EO principles respected here Managed by Zerocracy DevOps By Rultor.com We recommend IntelliJ IDEA

Build Status Build status PDD status jpeek report Hits-of-Code

Maven Central JavaDoc

This is a Java adapter to the GitHub RESTful API. There are a few other similar implementations on the market, but jcabi-github has a very strong focus on object-oriented principles of programming. On top of that, we have a unique implemenation of GitHub server-side functionality, which you can use in your unit tests, eliminating the necessity to connect to GitHub during unit/integration testing. Please, read the blog post Object-Oriented Github API by Yegor Bugayenko, the creator of this library.

Java 8 or higher is required.

More details are here: github.jcabi.com.

You may also get help in this Telegram chat.

The set of classes in the com.jcabi.github package is the object-oriented API. Use it like this:

Work with Github's API

By default, the library works with Github's API (https://api.github.com)

import com.jcabi.github.*;
public class Main {
  public static void main(String[] args) throws IOException {
    Github github = new RtGithub(".. your OAuth token ..");
    Repo repo = github.repos().get(
        new Coordinates.Simple("octocat/Hello-World")
    );
    Issue issue = repo.issues().create("Test title", "Test description");
    issue.comments().post("My first comment!");
  }
}

Work with Github Enterprise or other

If you want to work with Github's API through another domain, you can use the URI-constructors of class RtGithub. For instance, if you have your own instance of Github deployed under the domain https://github.mydomain.com, do the following:

final Github github = new RtGithub(URI.create("https://github.mydomain.com"));

//OR

final Github github = new RtGithub(
    "<<oauth2_token>>",
    URI.create("https://github.mydomain.com")
);

//OR

final Github github = new RtGithub(
    "username", "password",
    URI.create("https://github.mydomain.com")
);

DO NOT change or mask your URIs! Using Github under a different domain is fine but do not change the URI paths. Changing the requests' paths is not possible since the whole architecture of this library relies on Github's URI paths.

For more complex configurations, you can instantiate RtGithub with your own custom Request, by using the RtGithub(Request) constructor. Be sure to configure the Request properly. See how the default Request is created -- you basically have to do the same thing.

Mock Implementation Of The API

We also provide MkGithub, a mock version of the GitHub server, which you can use in your unit tests, for example:

import com.jcabi.github.*;
public class FooTest {
  public void submitsCommentToGithubIssue() {
    final Repo repo = new MkGithub().repos().create(
      Json.createObjectBuilder().add("name", "test").build()
    );
    final Issue issue = repo.issues().create("how are you?", "");
    new Foo(issue).doSomething(); // should post a message to the issue
    MasterAssert.assertThat(
      issue.comments().iterate(),
      Matchers.iterableWithSize(1)
    );
  }
}

How to contribute?

Fork the repository, make changes, submit a pull request. We promise to review your changes same day and apply to the master branch, if they look correct.

Please run Maven (3.1 or higher!) build before submitting a pull request:

$ mvn clean install -Pqulice

There are many integration tests that check our classes against live Github accounts. In order to run them, you should create a new Github OAuth access tokens (how?), and provide them in command line, like this:

$ mvn clean install -Dit.test=RtGistITCase -Dfailsafe.github.key=<token> -Dfailsafe.github.key.second=<second-token> -Dfailsafe.github.repo=<repo>

Replace <token> and <second-token> with the OAuth access tokens of two different Github accounts. This test case will try to fork a gist from first account into second. Replace <repo> with the name of repository you create in your first account (for test purposes only), for example yegor256/test. OAuth access tokens should have permissions in their respective repos to all scopes needed by the integration test suite you want to run (including delete_repo, which is not set by default!).

Please note that different integration tests may need keys with permissions to different scopes. To run all integration tests, the key should have the following OAuth scopes:

  • read:org
  • repo
  • delete_repo
  • admin:public_key
  • gist
  • admin:repo_hook
  • user
  • user:email

RtForksITCase requires additional parameter -Dfailsafe.github.organization=<organization> where <organization> is an organization name to fork test github repository.

In order to run static analysis checks only use this:

$ mvn clean install -DskipTests -Dinvoker.skip=true -Pqulice
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].