remove null values in json response
In staging, some fields in various response keys are displayed with null values.
Examples:
- Clinical-trial-number are displayed with null values:
The same fields are not included in production:
https://api.crossref.org/works?filter=clinical-trial-number:nct03746873&select=clinical-trial-number
-
Event: https://api.staging.crossref.org/works/10.5753/eniac.2019 vs http://api.crossref.org/works/10.5753/eniac.2019
-
Reference: Reference fields that are missing are not included in the JSON response in production at all:
https://api.crossref.org/works/10.3390/rs11212461
In staging, those fields appear in the response with value "null":
https://api.staging.crossref.org/works/10.3390/rs11212461
Definition of done
-
Available via a staging URL -
Code reviewed -
Unit tests identified, implemented, and passing -
Public documentation reviewed and updated -
Knowledge base reviewed and updated -
Acceptance criteria met -
do not include null values for clinical-trial-number
type
, fields in theevent
hashmap, and fields in thereference
hashmap -
If the value of a key is null or an empty container (maybe use seq
?), do not display that key
-
Edited by Patrick Polischuk