Skip to content

Commit

Permalink
print response values with "raw"
Browse files Browse the repository at this point in the history
  • Loading branch information
dphuang2 committed Nov 5, 2023
1 parent ccedee5 commit bcce793
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ try:
{{/with}}
{{/if}}
{{#unless pydantic}}
{{#if returnType}}
{{#or returnType raw}}
pprint({{operationId}}_response.headers)
pprint({{operationId}}_response.status)
pprint({{operationId}}_response.round_trip_time)
{{/if}}
{{/or}}
{{/unless}}
except ApiException as e:
print("Exception when calling {{classname}}.{{operationId}}: %s\n" % e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{#if returnType}}{{operationId}}_response = {{/if}}{{#if async}}await {{/if}}{{lower clientName}}.{{> api_doc_example_method}}{{^hasParams}}(){{/hasParams}}{{#hasParams}}(
{{#if returnType}}{{operationId}}_response = {{else}}{{#if raw}}{{operationId}}_response = {{/if}}{{/if}}{{#if async}}await {{/if}}{{lower clientName}}.{{> api_doc_example_method}}{{^hasParams}}(){{/hasParams}}{{#hasParams}}(
{{#if bodyParam}}
{{#with bodyParam}}
{{#unless isObject}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ pythonpydanticemptyresponse = PythonPydanticEmptyResponse(

try:
# Fetches a JSON value based on input parameter
pythonpydanticemptyresponse.test.raw.fetch()
fetch_response = pythonpydanticemptyresponse.test.raw.fetch()
pprint(fetch_response.headers)
pprint(fetch_response.status)
pprint(fetch_response.round_trip_time)
except ApiException as e:
print("Exception when calling TestApi.fetch: %s\n" % e)
pprint(e.body)
Expand Down

0 comments on commit bcce793

Please sign in to comment.