-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add optional flag allowing wrapping responses in a parent class for J… #192
Conversation
…S and TS client - Adds the `--wrap-response-in` flag which allows users to pass in a value - Response will be wrapped in the following way: `wrapper<type>` where `wrapper` is the string passed in with the flag, and `type` is the original response type
Codecov Report
@@ Coverage Diff @@
## master #192 +/- ##
==========================================
+ Coverage 51.11% 51.17% +0.06%
==========================================
Files 37 37
Lines 8340 8351 +11
Branches 1779 1781 +2
==========================================
+ Hits 4263 4274 +11
Misses 3757 3757
Partials 320 320
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 seems fine to me
stone/backends/js_client.py
Outdated
@@ -81,11 +87,21 @@ def _generate_route(self, route_schema, namespace, route): | |||
if route.deprecated: | |||
self.emit(' * @deprecated') | |||
|
|||
return_type = None | |||
if self.args.wrap_response_in: | |||
if route.result_data_type.__class__ != Void: |
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.
Isn't there value in still doing this for Void type? e.g. if you are providing access to headers with a Response wrapper class like we do in the SDK?
stone/backends/tsd_client.py
Outdated
fmt_type(route.result_data_type))) | ||
return_type = None | ||
if self.args.wrap_response_in: | ||
if route.result_data_type.__class__ != Void: |
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 as above.
* Update return types from T to DropboxResponse<T> - Fix bug introduced in v6.0.0 with the addition of the DropboxResponse class - Fixes issue ([#333](#333)) and ([#340](#340)) - Reflecting stone changes introduced in ([#192](dropbox/stone#192)) * Regenerate routes with new stone version Change Notes: File Namespace: - Add SearchOrderBy unioin - Add SearchMatchTypeV2 union - Update SearchOptions to include order_by - Update SearchMatchV2 to include match_type Team Audit Log Namespace: - Add TeamBrandingPolicy union - Add TeamBrandingPolicyChangedDetails struct - Add TeamBrandingPolicyChangedType struct - Update EventDetails to include team_branding_policy_changed_details - Update EventType to include team_branding_policy_changed - Update EventTypeArg to include team_branding_policy_changed Team Reports Namespace: - Deprecate reports/get_storage - Deprecate reports/get_activity - Deprecate reports/get_membership - Deprecate reports/get_devices
…S and TS client
--wrap-response-in
flag which allows users to pass in a valuewrapper<type>
wherewrapper
is the string passed in with the flag, andtype
is the original response typeChecklist
General Contributing
Is This a Code Change?
Validation
tox
?