Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

externally consumable REST API #48

Open
theroys opened this issue May 15, 2015 · 10 comments
Open

externally consumable REST API #48

theroys opened this issue May 15, 2015 · 10 comments

Comments

@theroys
Copy link
Contributor

theroys commented May 15, 2015

Creating an external user specific REST API ,whereby OSSRank will provide ranking and other metadata to outside world

@fsiddiqi
Copy link
Contributor

+1, this will be an extension of the current API

Existing REST APIs:

  • /api/projects
  • /api/projects/{id}
  • /api/categories
  • /api/categories/{id}
  • /api/search

Ideas:

  • Since this API is growing, we can start design REST resources in swagger and publish as API doc
  • Extend to query and filter each resource

Please add ideas

@sorin-costea
Copy link
Collaborator

The current "API" search-like call
/api/category_map?category=somecategory
could be replaced with somehing like:
/api/categories/{id}/projects

@sorin-costea
Copy link
Collaborator

As an idea, also the real search
/api/search?term=searchterm
could use instead:
/api/categories?keywords=searchterm

@sorin-costea
Copy link
Collaborator

Especially the projects could use pagination (1-based, default size 100):
/api/projects?page=1&pagesize=100
/api/categories/{id}/projects?page=1&pagesize=100

@sorin-costea
Copy link
Collaborator

What is returned by
/api/category_map?category=somecategory
and by the
/api/projects?tages=sometag
should be the same thing (a partial projects response), like:

{
    "projects": [
    {
        "_id": {
        "$oid": "559ac491e4b0a61755104a8d"
        }, 
        "_rank": 9483, 
        "description": "", 
        "name": "angular"
    }, 
    {

@sorin-costea
Copy link
Collaborator

Results lists could be accompaned by the results size:

{
    "categories": [],
    "size": 0
}

@sorin-costea
Copy link
Collaborator

Is there a strong reason to have some fields prefixed with an underscore?

@sorin-costea
Copy link
Collaborator

Errors objects should be standalone reply objects - not just cram error messages inside regular answers like this answer from http://localhost:8080/api/projects?filter=1&tags=angular|java

{
  "projects": {
    "class": "com.mongodb.MongoException$Network", 
    "message": "Read operation to server blahblah.mongolab.com:12345 failed on database ossrank", 
    "stackTrace": [...

@fsiddiqi
Copy link
Contributor

underscore prefix explanation: we're adding these elements to existing JSON structures received from various APIs. The underscore was a convention to easily identify these attributes. Alternatives welcome

@sorin-costea
Copy link
Collaborator

Ok fine with the underscores - how about we also document why :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants