k4cg / matomat-service

Matomat as a Service (MaaS)
MIT License
5 stars 2 forks source link

Reject invalid cost number format #6

Open noqqe opened 5 years ago

noqqe commented 5 years ago

Hi,

I create drinks with

items_client.items_post(name, cost)

cost does not seem to have effect. I specify 100 (1 Euro in cents) and it results in 0 in the backend.

Can you have a look?

noqqe commented 5 years ago

This is not a bug anymore. Its just not-so-nice behaviour.

I posted a float(100) and not a int(100) and the API silently accepted my request with 200 but did not change the value.

So if you like, you may want to throw an error message if the type of the input is not correct.

winterMate commented 5 years ago

Hm, right, the API is specified to accept only int, but it is not enforced ...