Skip to content

Conversation

@syky27
Copy link
Contributor

@syky27 syky27 commented Jul 12, 2020

Otherwise this will generate code which is not compile-able. Like this:

        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

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./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.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@kuhnroyal
Copy link
Contributor

@syky27 Can you check the boxes and cc the technical committee so maybe this can get merged.

@kuhnroyal
Copy link
Contributor

The Map<String, String> headers parameter should also become Map<String, dynamic> headers.

@syky27
Copy link
Contributor Author

syky27 commented Sep 29, 2020

@amondnet could you please review?

@syky27
Copy link
Contributor Author

syky27 commented Oct 5, 2020

Ok then, calling maintainers, can someone review?
@ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @athornz (2019/12) @amondnet (2019/12) @noordawod @sbu-WBT @josh-burton

@noordawod
Copy link
Contributor

If we do this for dart-dio, then we should do it for other dart templates to be consistent. So I suggest the author to visit those and make the same changes, shouldn't be that difficult.

@agilob
Copy link
Contributor

agilob commented Nov 14, 2020

@wing328 can we get this merged please?

@syky27
Copy link
Contributor Author

syky27 commented Nov 14, 2020

@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...

@agilob
Copy link
Contributor

agilob commented Nov 14, 2020

Dont force yourself if you dont want to

@syky27
Copy link
Contributor Author

syky27 commented Nov 16, 2020

@agilob it is not about if I want, it is about the time I have available ;)

@kuhnroyal
Copy link
Contributor

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.

@kuhnroyal
Copy link
Contributor

@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
@kuhnroyal
Copy link
Contributor

This needs a new rebase/merge. Otherwise I have the same changes in #8191

@wing328
Copy link
Member

wing328 commented Dec 16, 2020

I've tried to merge the latest master into the branch via ce4f33b. Let's see how that goes.

@kuhnroyal
Copy link
Contributor

kuhnroyal commented Dec 16, 2020

Looks like it can be merged. Failure looks unrelated.

@wing328
Copy link
Member

wing328 commented Dec 16, 2020

CircleCI failure not related to this change.

@wing328 wing328 merged commit 180fae0 into OpenAPITools:master Dec 16, 2020
@wing328 wing328 added this to the 5.0.0 milestone Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants