Purchase Order example gotcha


(Rope Trick) #1

When I try the purchase order cordApp-template example to create a new order:
echo '{"orderNumber": "2","deliveryDate": "2018-09-15","deliveryAddress": {"city": "London","country": "UK"},"items" : [{"name": "widget","amount": "33"},{"name": "thing","amount": "44"}]}' | curl -T - -H 'Content-Type: application/json' http://localhost:10005/api/example/NodeB/create-purchase-order

I keep getting the error

You can only order up to 100 items in total.

Searching for the message in /src/main/kotlin/com/example/contract/PurchaseOrderContract.kt
reveals the gotcha. [ The check is for 10 instead of 100]

Nice ‘inadvertent’ bug by the developer! made me read/understand the code. Hi5!


(Roger Willis) #2

Which release are you using? M6 or master? Pretty sure we fixed this but thanks for the heads up :slight_smile:


(Sweta Kedia) #3

This is in M6 release.


(Roger Willis) #4

Thanks - will be changed for M7.