-
Notifications
You must be signed in to change notification settings - Fork 531
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
support for params having multiple values #681
base: main
Are you sure you want to change the base?
Conversation
@ashitaprasad I am familiar with the codebase; however, I need to explore the test files further before making the necessary updates. I plan to work on that after updating codegen for all languages. In the meantime, please review the implementation and share your feedback. |
@animator I request you to take a look(Feedback on the major changes is enough) . I've updated the code generation for all supported languages to handle parameters with multiple values. Before I move on to writing/updating tests, I just want to ensure that all changes are aligned with expectations . |
@@ -34,14 +34,28 @@ class HttpRequestModel with _$HttpRequestModel { | |||
_$HttpRequestModelFromJson(json); | |||
|
|||
Map<String, String> get headersMap => rowsToMap(headers) ?? {}; | |||
Map<String, String> get paramsMap => rowsToMap(params) ?? {}; | |||
Map<String, dynamic> get paramsMap => rowsToRequestMap(params) ?? {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params map should have a strict datatype - Map<String, List>
List<NameValueModel>? get enabledHeaders => | ||
getEnabledRows(headers, isHeaderEnabledList); | ||
List<NameValueModel>? get enabledParams => | ||
getEnabledRows(params, isParamEnabledList); | ||
|
||
Map<String, String> get enabledHeadersMap => rowsToMap(enabledHeaders) ?? {}; | ||
Map<String, String> get enabledParamsMap => rowsToMap(enabledParams) ?? {}; | ||
Map<String, dynamic> get enabledParamsMap { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for enabled params
@@ -12,7 +12,7 @@ class RequestDataTable extends StatelessWidget { | |||
this.valueName, | |||
}); | |||
|
|||
final Map<String, String> rows; | |||
final Map<String, dynamic> rows; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can no longer be a map
@badnikhil do not conversations as resolved. You have to comment if you have fixed it, then the reviewer verifies the fix and marks it is resolved. |
Sorry about that, I’ll keep it in mind from now on. |
PR Description
The request parameters were previously handled as a
Map<String, String>
. I have updated this toMap<String, dynamic
to support multiple values when needed.(List if param have multiple values String otherwise)Additionally, I have modified the relevant implementations to accommodate this change.
Related Issues
Checklist
main
branch before creating this PR.flutter upgrade
verified).flutter test
), and they pass successfully.Added/Updated Tests?
We encourage contributors to add relevant test cases.
Development & Testing Environment