Open-event-droidgen: Implement support for json-api

Created on 9 Jun 2017  Â·  42Comments  Â·  Source: fossasia/open-event-droidgen

The Open Event Server is moving towards a new API as per the json-api specification. Hence all the client apps need to support the same.

You can checkout some of the Android client libraries that you can use to easily consume the API at http://jsonapi.org/implementations/#client-libraries-android.

Please note that the zip format is not changing and only the API format is and the android app needs to support both. (Incase the user uploads a zip and generates an app.)

Core Feature High has-PR

Most helpful comment

A tentative API doc is viewable at https://api.eventyay.com

On Fri, Jun 16, 2017, 10:02 AM Arpit Aggarwal notifications@github.com
wrote:

@iamareebjamal https://github.com/iamareebjamal
just to clarify, the server response would change which would mean the
models right?
are we given a sample response for the sample api?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fossasia/open-event-android/issues/1680#issuecomment-308930575,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACSwFIRR3ERtXAer5RFlcWOPMOa7y5AYks5sEgVdgaJpZM4N03Z2
.

All 42 comments

@niranjan94 Can we get sample response from the server?

can i work on the api format?

Sure @arp95 but we have to work on designing documents and models such that they can be parsed from JSONAPI spec

The real problem is that every library requires inheritance from a base class, and Realm does too

@iamareebjamal you can see how json-api compatible responses look here -> http://jsonapi.org and everything that is supported. (Sorting, paging, filtering etc)

Server API docs are still a WIP and event API is still pending merge. Would done by the end of this week. That's why this issue has been assigned to Milestone 6.

@arp95 @rohanagarwal94 @shreyasnbhat @Shailesh351 @mahikaw We need to discuss the implementation ASAP. How should we handle it so that no major refactoring is needed, and also, how to handle inheritance required by almost all JSONAPI libraries as we already inherit from RealmModel. I think this issue needs to be collectively solved. We have a week. I also urge you to complete your pending PRs and issues ASAP and not take up any new issues (unless critical bugs), and work together to implement JSONAPI compatible app. The best way to start it will be to view any mock JSON api and try to convert it into standard models by consumption through retrofit in such a way that we don't have to rewrite our whole models. As I am working on Orga App and it also needs to solve this issue, we can design a strategy together which will solve both issues as the data set for both is same

@iamareebjamal the response would change or the api link too?

Both would be changing.

On Mon, Jun 12, 2017, 7:41 PM Arpit Aggarwal notifications@github.com
wrote:

@iamareebjamal https://github.com/iamareebjamal the response would
change or the api link too?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fossasia/open-event-android/issues/1680#issuecomment-307801181,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACSwFIfBeFnrNZKVqrN95E2_NQXqUTr2ks5sDUb9gaJpZM4N03Z2
.

is it complete @niranjan94 ?

Not yet

Please take a look at this -> https://github.com/jasminb/jsonapi-converter

Does not need inheritance but uses Jackson instead of Gson. Shouldn't be a problem as gson is not a hard dependency for us, and retrofit supports jackson. Play with it a little bit and see if it conforms well to our models

does it has other advantage over gson? @iamareebjamal

Not that I know. It's very old and standard library used in servers and all. That's why people have implemented it using this

As @iamareebjamal suggested in https://github.com/fossasia/open-event-orga-app/issues/178 we need a common API library to parse Open Event JSONAPI to models.I think we should start working on it now.

We need support for both open-event-archive-format and json-api.

What functionalities open-event-android-sdk will have ?

  • make request to server and server will give response in json-api format.
  • It will have json-api format models for all data.
  • Able to serialise data from json-api format to current open-event-archive-format.

What should be better approach ? @iamareebjamal @niranjan94 @arp95 @shreyasanbhat @rohanagarwal94.

How should we proceed ?

@Shailesh351 I am currently making mock models for server response till the API is not finalized.
I am creating a JSON API mock response for /event endpoint
I'll confirm the format with Niranjan and post the mock here

Tentative format is here : https://api.eventyay.com

Then, we should start right away by converting these static samples to our current models. Easiest way for it to work would be to do it in a Java Project rather than Android and for one person to convert one model (Given no dependency on other model)

I am converting event model, you do microlocation. @shreyasnbhat You do sponsor as they are not dependent on others

@iamareebjamal can you link where you are working?
its better we can follow along too.

I'm currently working locally (not started project as I was making mock response), but will create a project soon. Or any one of you can do it.

@iamareebjamal
just to clarify, the server response would change which would mean the models right?
are we given a sample response for the new api?

Yes, I misunderstood. This is the model API, not server response, but our model structure should not change at all as it conforms to the sample API

A tentative API doc is viewable at https://api.eventyay.com

On Fri, Jun 16, 2017, 10:02 AM Arpit Aggarwal notifications@github.com
wrote:

@iamareebjamal https://github.com/iamareebjamal
just to clarify, the server response would change which would mean the
models right?
are we given a sample response for the sample api?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fossasia/open-event-android/issues/1680#issuecomment-308930575,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACSwFIRR3ERtXAer5RFlcWOPMOa7y5AYks5sEgVdgaJpZM4N03Z2
.

Follow here. Play around a little bit https://github.com/iamareebjamal/open-event-android-sdk

I think the best way to map one object to other would be to write an annotation processor and set the mapped field from original object to the clone one

I forgot to mention here yesterday on which model I was working, and due to this mistake, someone else was working on it too. Please mention which model you are working on @shreyasnbhat @Shailesh351

I am currently working on sessions Model.

I am working on the Sponsor Model

@iamareebjamal Can you please add task list in this issue so that we can see current status i.e. how much work is done and how much is remaining.

I'll be working on speaker then

@Shailesh351 sure

I think this should be in the library repo so Orga App developers can see this too

any model left which i can work on?

@arp95 You can work on speaker model as I am currently busy with Orga App

@iamareebjamal sorry for the late acknowledgement. Anywhere I could be of help?

You can check orga app models and add their json and parser in the app

Should i remove LicenseDetails model?
Because it is not in Open Event Universal Format and new jsonapi also. I think LicenseDetails is same as Copyright.

@Shailesh351 you're right. License details is copyright.

Are we also removing version attribute from event model for jsonapi ?

i am working on event model. so license details should be removed right?

@Shailesh351 yes we are.
@arp95 yes. it should be removed. we have copyright instead of it

Are you also working on speakers model apart from event model @arp95 ? If not, shall I work on it?

yes you may. please ensure we provide support for old api also as pointed out earlier.

@arp95 I probably missed the conversation. Could you point me to the conversation about having support for the old API too ?

@niranjan94
it wasnt done over here and as i pointed out there that we need to have support for only new api now but some of the team members dont agree.
please clear it out. https://github.com/fossasia/open-event-android/pull/1767

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dr0pdb picture dr0pdb  Â·  5Comments

97k picture 97k  Â·  5Comments

iamareebjamal picture iamareebjamal  Â·  3Comments

mahikaw picture mahikaw  Â·  7Comments

dr0pdb picture dr0pdb  Â·  3Comments