animo93 / jrest Goto Github PK
View Code? Open in Web Editor NEWA Java Rest Client developed on the lines of HttpUrlConnection
License: MIT License
A Java Rest Client developed on the lines of HttpUrlConnection
License: MIT License
Currently Gson is the default converter for transforming the Response Body .
Need to provide a feature where a custom Converter can be plugged in to the API Builder .
User can write his/her own custom transformers to handle the transformation of the incoming Response body
Currently Headers can be set globally while building the API only . Need to enable Headers as a static input in the API contract and dynamic input as a parameter
Currently no custom or default interceptors are present in JRest.
Need to add an enhancement to add custom/default interceptors
Currently each API needs to be defined and called specifically for the execution
For example :-
In below service Interface
public interface MyApiInterface {
@REQUEST(endpoint = "/users/{user}/repos",type = HTTP_METHOD.GET)
APICall<Void,ApiResponse> listRepos(@PATH(value = "user") String user);
}
API needs to be called as below :-
MyApiInterface testInterface = testAPIHelper.createApi(MyApiInterface.class);
APICall<Void, Map<String,Object>> call = testInterface.listRepos("testUser");
APICall<Void,Map<String,Object>> response = call.callMeNow();
The New Implementation should be as below
MyApiInterface testInterface = testAPIHelper.createDynamicApi(MyApiInterface.class,"listRepos");
APICall<Void, Map<String,Object>> call = testInterface.dynamicAPIInvocation("testUser");
APICall<Void,Map<String,Object>> response = call.callMeNow();
I would like to make a few formatting suggestions if you are open to them.
Hi, I see issues labelled as "good-first-issue".
Is this repo open to taking contributions?
Currently each requests needs to be retried manually by the developer .
Need to add an enhancement to add a retry mechanism to each request upon receiving any connectivity failures ( can be customisable)
Currently the path URL needs to be set while defining the API Interface .
So , need to enable path URL in the API method as a parameter . It should be along the below lines :-
Call<List> groupList(@url String url);
Currently there is a open bug in HttpUrlConnection , where it sends an illegal "Accept" header field , in all it's connection.
https://bugs.openjdk.java.net/browse/JDK-8163921
So , need to provide a fix for the same
Currently http API calls aren't supported
Need to fix this to support both https & http API calls
Currently Query can be set globally while building the API only . Need to enable query parameter in the API method as a parameter . It should be along the below lines
Call<List<User>> groupList(@Path("id") int groupId, @Query("sort") String sort);
and
Call<List<User>> groupList(@Path("id") int groupId, @QueryMap Map<String, String> options);
Currently HttpUrlConnection doesn't support Http Patch/Put methods .
There is a Won't Fix bug in OpenJDK for this:
https://bugs.openjdk.java.net/browse/JDK-7016595
So , need to provide a fix along the below stackoverflow solution
https://stackoverflow.com/a/46323891/3647724
Enable a caching feature for data fetched via JRest . Caching would be an optional feature and can be implemented either by memcache or Redis .
User would have the option to set the caching duration and frequency
Currently JRest only supports Custom object as a Request Body .
Need to implement changes for supporting Map as a Request Body also
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.