Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix scoring endpoint HTTP behavior #110

Copy link
Copy link
@algattik

Description

@algattik
Issue body actions
  1. Scoring endpoint should return json, not stringified json
curl -H "Authorization: Bearer $token" $scoringUri \
  -d '{"data":[[1,2,3,4,5,6,7,8,9,10],[10,9,8,7,6,5,4,3,2,1]]}' \
  -H Content-type:application/json

Returns:

"{\"result\": [5113.099642122809, 3713.6329271385334]}"

Expected:

{"result": [5113.099642122809, 3713.6329271385334]}

Probably we should avoid json.dumps() in:

return json.dumps({"result": result.tolist()})

  1. Scoring endpoint should not return 200 in case of error

Exceptions are swallowed at

except Exception as e:

The code should not only return the error message but also set an appropriate HTTP return code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.