public List < Advisory > parse ( JSONObject jsonResponse ) { LOGGER . debug ( "Parsing JSON node" ) ; final List < Advisory > advisories = new ArrayList <> ( ) ; final JSONObject jsonAdvisories = jsonResponse . getJSONObject ( "advisories" ) ; final Iterator < ? > keys = jsonAdvisories . keys ( ) ; while ( keys . hasNext ( ) ) { final String key = ( String ) keys . next ( ) ; final Advisory advisory = parseAdvisory ( jsonAdvisories . getJSONObject ( key ) ) ; advisories . add ( advisory ) ; } return advisories ; }
Parses the JSON response from the NPM Audit API .