machinebox / issues

Machine Box issues, bugs and feature requests
2 stars 0 forks source link

classificationbox: 500 Internal Server Error #24

Closed pkallberg closed 6 years ago

pkallberg commented 6 years ago

I'm POSTing the provided example payload to http://localhost:8080/classificationbox/models/ecommerce/teach:

{
    "class": "Price",
    "inputs": [
        {
            {"key": "user_age", "type": "number", "value": "25"},
            {"key": "user_interests", "type": "list", "value": "music,cooking,ml"},
            {"key": "user_location", "type": "keyword", "value": "London"}
        }
    ]
}

And receiving a HTTP 500 back with message invalid character '{' looking for beginning of object key string

dahernan commented 6 years ago

it seems it has some extra braces on the inputs

I need to confirm but this should work

{
    "class": "Price",
    "inputs": [
            {"key": "user_age", "type": "number", "value": "25"},
            {"key": "user_interests", "type": "list", "value": "music,cooking,ml"},
            {"key": "user_location", "type": "keyword", "value": "London"}
    ]
}
matryer commented 6 years ago

You're right, it was a bug in the documentation.

I think it's fixed if you pull the latest box.

pkallberg commented 6 years ago

Yeah all good, thanks!