"study" projection request returns an unexpected error 500 response
Created by: ramiromagno
In the documentation docs/sample-scripts under the Section Searching and projections the link therein that leads to an API request using the study projection returns an unexpected 500 error:
curl 'http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364?projection=study' -i -H 'Accept: application/json'
returns a 500 error:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Date: Mon, 08 Oct 2018 15:45:13 GMT
X-Application-Context: application
Expires: 0
X-XSS-Protection: 1; mode=block
Pragma: no-cache
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
Connection: close
X-Frame-Options: DENY
{"timestamp":1539013513977,"status":500,"error":"Internal Server Error","exception":"org.springframework.http.converter.HttpMessageNotWritableException","message":"Could not write content: Invalid property 'publication' of bean class [uk.ac.ebi.spot.goci.model.Study]: Could not find field for property during fallback access! (through reference chain: org.springframework.data.rest.webmvc.json.ProjectionResource[\"content\"]->$Proxy456[\"publication\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Invalid property 'publication' of bean class [uk.ac.ebi.spot.goci.model.Study]: Could not find field for property during fallback access! (through reference chain: org.springframework.data.rest.webmvc.json.ProjectionResource[\"content\"]->$Proxy456[\"publication\"])","path":"/gwas/rest/api/studies/GCST004364"}
Without the "study" projection, we get a code 200 response for the same study accession (GCST004364
):
curl 'http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364' -i -H 'Accept: application/json'
returns
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Application-Context: application
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 08 Oct 2018 15:46:23 GMT
{
"initialSampleSize" : "up to 58,799 European ancestry adults, up to 19,509 European ancestry children",
"gxe" : false,
"gxg" : false,
"snpCount" : 12104294,
"qualifier" : null,
"imputed" : true,
"pooled" : false,
"studyDesignComment" : null,
"accessionId" : "GCST004364",
"fullPvalueSet" : true,
"userRequested" : false,
"platforms" : [ {
"manufacturer" : "Affymetrix"
}, {
"manufacturer" : "Illumina"
} ],
"ancestries" : [ {
"type" : "initial",
"numberOfIndividuals" : 78308,
"ancestralGroups" : [ {
"ancestralGroup" : "European"
} ],
"countryOfOrigin" : [ {
"majorArea" : "NR",
"region" : "NR",
"countryName" : "NR"
} ],
"countryOfRecruitment" : [ {
"majorArea" : "Northern America",
"region" : null,
"countryName" : "U.S."
}, {
"majorArea" : "Oceania",
"region" : "Australia/New Zealand",
"countryName" : "Australia"
}, {
"majorArea" : "Europe",
"region" : "Western Europe",
"countryName" : "Netherlands"
}, {
"majorArea" : "Europe",
"region" : "Northern Europe",
"countryName" : "Sweden"
}, {
"majorArea" : "Europe",
"region" : "Northern Europe",
"countryName" : "U.K."
} ]
} ],
"diseaseTrait" : {
"trait" : "Intelligence"
},
"genotypingTechnologies" : [ {
"genotypingTechnology" : "Genome-wide genotyping array"
} ],
"replicationSampleSize" : "NA",
"publicationInfo" : {
"pubmedId" : "28530673",
"publicationDate" : "2017-05-21",
"publication" : "Nat Genet",
"title" : "Genome-wide association meta-analysis of 78,308 individuals identifies new loci and genes influencing human intelligence.",
"author" : {
"fullname" : "Sniekers S",
"orcid" : null
},
"_links" : {
"studies" : {
"href" : "http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364{?projection}",
"templated" : true
}
}
},
"_links" : {
"self" : {
"href" : "http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364"
},
"study" : {
"href" : "http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364{?projection}",
"templated" : true
},
"associationsByStudySummary" : {
"href" : "http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364/associations?projection=associationByStudy"
},
"associations" : {
"href" : "http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364/associations"
},
"snps" : {
"href" : "http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364/snps"
},
"efoTraits" : {
"href" : "http://www.ebi.ac.uk/gwas/rest/api/studies/GCST004364/efoTraits"
}
}
}