-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[DART-DIO] [GENERATOR] Make header params with dynamic types #6915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@syky27 Can you check the boxes and cc the technical committee so maybe this can get merged. |
|
The |
|
@amondnet could you please review? |
|
Ok then, calling maintainers, can someone review? |
|
If we do this for |
|
@wing328 can we get this merged please? |
|
@agilob I think it waits on implementing these changes into all dart templates to be consistent, as @noordawod pointed out. I will try to take a look on those this week... |
|
Dont force yourself if you dont want to |
|
@agilob it is not about if I want, it is about the time I have available ;) |
|
This should be merged. The Dart2 client doesn't share much with the Dart-dio client except the language. Besides that, as far as I can see the Dart2 client doesn't even expose the headers as parameters. |
|
@syky27 Can you rebase this please, I really don't think there are any changes needed in the normal dart generator. I am sure we can get this merged. |
Otherwise this will generate code which is not compile-able. Like this:
```dart
Future<Response<List<StockItemProjectionDirect>>>getAllStockItems(Store storeId,{ int xXChunkNumber,int xXChunkSize,StockItemRequestFilterDto stockItemRequestFilterDto,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
String _path = "/api/store/{storeId}/stock".replaceAll("{" r'storeId' "}", storeId.toString());
Map<String, dynamic> queryParams = {};
Map<String, String> headerParams = Map.from(headers ?? {});
dynamic bodyData;
headerParams[r'XX-Chunk-Number'] = xXChunkNumber;
headerParams[r'XX-Chunk-Size'] = xXChunkSize;
```
See how the func recieves int argument which then assignes into a string... last 2 lines
|
This needs a new rebase/merge. Otherwise I have the same changes in #8191 |
|
I've tried to merge the latest master into the branch via ce4f33b. Let's see how that goes. |
|
Looks like it can be merged. Failure looks unrelated. |
|
CircleCI failure not related to this change. |
Otherwise this will generate code which is not compile-able. Like this:
See how the func recieves int argument which then assignes into a string... last 2 lines
PR checklist
./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/config/java*. For Windows users, please run the script in Git BASH.master