o2r-project / api

Reproducibility service RESTful web API specification and documentation
https://o2r.info/api
Other
3 stars 8 forks source link

suggestions for API extension to accommodate erc-checker #61

Closed Timmimim closed 7 years ago

Timmimim commented 7 years ago

I extended the Job Doc, which now presents the new Step "check", as well as the Job JSON example, including an example for a Check Result JSON, formatted in a similar fashion as the already included Steps.

There is also a suggestion for a new URL parameter. By default, a GET request for a particular Job will only feature limited information about the different steps of the job. That is to avoid superfluous data traffic, since the merged diffHTML, which are included as Strings in each Checker result JSON, may be pretty large (>5mb).

By using the new URL parameter details, a user (/developer) may decide what step they want to recieve detailed information on. I suggest the option all to get all the details on all the steps, or instead listing each step required.

nuest commented 7 years ago

@jansule Please take a look at these changes if this is a workable solution from the UI perspective.

nuest commented 7 years ago

@Timmimim I have another request for a change: Can you rename errorsEncountered to simply errors, because unencountered errors are not a thing at all. Please also update the checker.

nuest commented 7 years ago

@Timmimim Can you confirm that diffHTML in the API and resultHTML in the ERC checker documentation are referring to the same content?

If so, I would prefer to use matching names. And since the properties images also has no result.., I suggest to put the HTML into a property display.diff, since there might be other reasonable things to display.

    "check": {
      "status": "success",
      "images": [
        {
          "imageIndex": 0,
          "resizeOperationCode": 0,
          "compareResults": {
            "differences": 0,
            "dimension": 1290240
          }
        }
      ],
      "display": {
        "diff":  "[merged HTML with difference highlighting for images]"
      }
      "start": "2017-10-23T08:45:01.168Z",
      "end": "2017-10-23T08:45:02.193Z",
      "errors": []
    }
Timmimim commented 7 years ago

Valid points!

errorsEncountered is no more, also in the checker, PR follows shortly.

As for resultHTML / diffHTML, YES, I can confirm they are the same and I only changed the namespace, I do not remember why. Both namespaces are now changed to the requested form using display: { diff: ... } in both Web-Api and Checker.