Skip to content

The example code on the front page does not return errors #825

@skovmand

Description

@skovmand

Hi! Thanks for your nice project!

I just tried running the basic example in the repository README.md.
It compiles and runs well, but the error message given as example is not returned.

This example is given in README.md:

$ curl localhost:8080/orders/shoes -d '{ "name": "Chashu", "legs": 4 }'
Hello, Chashu! I've put in an order for 4 shoes

$ curl localhost:8080/orders/shoes -d '{ "name": "Mary Millipede", "legs": 750 }'
number too large to fit in target type

The first response works as expected, but I get no response from the second request. It's simply empty with a 422 HTTP Status Code. It seems related to #739

So perhaps it simply the README.md that needs to be updated (or perhaps a change to the code to return the error).

My curl output (with verbose mode):

$ curl localhost:8080/orders/shoes -d '{ "name": "Mary Millipede", "legs": 750 }' -v
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /orders/shoes HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 41
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 41 out of 41 bytes
< HTTP/1.1 422 Unprocessable Entity
< content-length: 0
< date: Fri, 23 Apr 2021 18:52:16 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions