Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
66 stars 23 forks source link

Align verbose and non verbose json output format #229

Closed demeringo closed 8 months ago

demeringo commented 9 months ago

Problem

The structure of json impacts returned slightly differs depending if we request a verbose or non-verbose format.

In non verbose , imapcts are returned at the root level

{
  "gwp": {
    "embedded": {
      "value": 0.0015724,
      "significant_figures": 5,
      "min": 0.00090127,
....
}

In verbose impacts are returned under an ìmpact` top level object

{
  "impacts": {
    "gwp": {
     .....
      },
 ....
  },
  "verbose": {
    "duration": {
      "value": 35040,
      "unit": "hours"
    },
    "ASSEMBLY-1": {
     ....
    },

Solution

Always return impacts under an ìmpacts`object

Alternatives

Additional context or elements

demeringo commented 9 months ago

@da-ekchajzer please ping me if you include this to dev branch (I may have to do small updates on cloud scanner to remain compatible).

da-ekchajzer commented 8 months ago

Ping. Fixed with latest commit.