chopper
chopper copied to clipboard
'with' can't be used as an identifier because it's a keyword.
Hi there, I have next request. One of my parameters named $with. $with is allowed name by CodeBuilder and DartFormatter classes. Anyway I received error. Possible problem in chopper_generator.
@Get(path: '/v1/customer/{customerId}') Future<chopper.Response> v1CustomerCustomerIdGet({ @Header() required String? xCus, @Path('customerId') required String? customerId, @Query() required String? $with, });
Next error is appeared:
Could not format because the source could not be parsed: line 8, column 37 of .: 'with' can't be used as an identifier because it's a keyword. 8 │ final $params = <String, dynamic>{'$with': $with};
In 4.0.0-nullsafety.0 everything was OK
Interesting remark: if fieldname = 'a$with' it failed too.
Can someone take a look at it?
We mostly need it for codegen based on swagger files.
$with
should be the completely OK name.
I haven't looked yet, but probably related to https://github.com/lejard-h/chopper/issues/258?
I have released the new version. Could you please check if it helped? :)
Hi @JEuler , Sorry did not checked it yet. Will take a look during weak or two
I have checked - not working yet(
@JEuler @Vovanella95 is this still an issue?
Personally, I don't think so. But it is presents still. :)