Jaguar-dart / client

Contains various packages for client side
46 stars 22 forks source link

Missing quotes in generated output for formfield body. #57

Closed rhalff closed 5 years ago

rhalff commented 5 years ago

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);
rhalff commented 5 years ago

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

tejainece commented 5 years ago

Released to pub as 2.8.9.