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

Publications Rest API Endpoint to Get All Publications #63

Open
sprintell opened this issue Sep 20, 2024 · 1 comment
Open

Publications Rest API Endpoint to Get All Publications #63

sprintell opened this issue Sep 20, 2024 · 1 comment

Comments

@sprintell
Copy link
Member

As developer I want a publication API endpoint such that that when I send a GET request to the URL, hateoas compliant, paginated list of all publications in the database is returned in JSON Format
This new endpoint:

  • is required to ensure scalability, it was wrongly designed in old APi, as publication which is a parent of studies was embedded inside studies
  • It also required to avoid circular reference errors in the JSON API
{
   "pubmedId":"21041247",
   "publicationDate":"2010-11-01",
   "publication":"Am J Psychiatry",
   "title":"Genome-wide association study of suicide attempts in mood disorder patients.",
   "firstAuthor":{
  	"fullname":"Perlis RH",
  	"orcid":null,
  	"affiliation":""
   },
   "authors":[
  	{
     	"fullname":"Perlis RH",
     	"orcid":null,
     	"affiliation":""
  	},
  	{
     	"fullname":"Perlis RH",
     	"orcid":null,
     	"affiliation":""
  	}
   ],
    "_links": {
        	"self": {
          	"href": "{base_url}/v1/publications/{pubmedId}"
        	},
        	"search": {
          	"href": "{base_url}/v1/publications?study_accession_id"
        	}
     }
}

Management Rules

  • Rule 1: Endpoint - /v1/publications
  • Rule 2: HTTP Request Method - GET
  • Rule 3: Endpoint should accept filter, and sort parameters as in /v1/publications?pubmedId=...&title=...&page=0&size=20&sort=...
  • Rule 4: Search filter should be available for: title, and pubmedId
  • Rule 5: Endpoint should be accessible to All

Acceptance Tests

  • Given no parameter, when the front end sends a GET request to the endpoint
  • Hateoas compliant list of publications is returned in JSON Format
  • Given sorting, pagination, and/or some search and filter parameters
  • When the front end sends a GET request to the same endpoint
  • Hateoas compliant filtered list of publications satisfying the conditions in the url parameter must be returned

Additional details here

@sajo-ebi
Copy link
Contributor

Local Code changes done

@sajo-ebi sajo-ebi assigned sajo-ebi and unassigned sprintell Oct 30, 2024
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

2 participants