Jaguar-dart / client

Contains various packages for client side

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing quotes in generated output for formfield body.

rhalff opened this issue · comments

I have an api defined like this:

 @PostReq(path: '/shoppingcart/add')
 Future<List<CartWithProduct>> shoppingcartAddPost(
   @AsFormField() String cartId,
   @AsFormField() String attributes,
 );

But it generates the keys without quotes:

  Future<List<CartWithProduct>> shoppingcartAddPost(
      String cartId, int productId, String attributes) async {
    var req = base.post
        .path(basePath)
        .path("/shoppingcart/add")
        .urlEncodedFormField(cartId, cartId)
        .urlEncodedFormField(attributes, attributes);
    return req.go(throwOnErr: true).map(decodeList);
  }

The correct output should be:

        .urlEncodedFormField("cartId", cartId)
        .urlEncodedFormField("attributes", attributes);

Thanks for creating this whole jaguar ecosystem btw, overall it's quite nice to work with.

Released to pub as 2.8.9.