forked from loafle/openapi-generator-original
fix stream_callback doc (#12879)
This commit is contained in:
parent
ed6280b0f7
commit
40c87e125c
@ -52,8 +52,12 @@ result <- tryCatch(
|
|||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}data_file = "result.txt"),
|
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}data_file = "result.txt"),
|
||||||
|
{{#vendorExtensions.x-streaming}}
|
||||||
|
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||||
|
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) }),
|
||||||
|
{{/vendorExtensions.x-streaming}}
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#vendorExtensions.x-streaming}}, stream_callback = function(x){ print(length(x)) }{{/vendorExtensions.x-streaming}}),
|
api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
# In case of error, print the error object
|
# In case of error, print the error object
|
||||||
@ -72,6 +76,14 @@ if (!is.null(result$ApiException)) {
|
|||||||
{{/useRlangExceptionHandling}}
|
{{/useRlangExceptionHandling}}
|
||||||
{{/returnExceptionOnFailure}}
|
{{/returnExceptionOnFailure}}
|
||||||
{{^useRlangExceptionHandling}}
|
{{^useRlangExceptionHandling}}
|
||||||
|
{{#returnType}}
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# result <- api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}data_file = "result.txt")
|
||||||
|
{{/returnType}}
|
||||||
|
{{#vendorExtensions.x-streaming}}
|
||||||
|
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||||
|
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) })
|
||||||
|
{{/vendorExtensions.x-streaming}}
|
||||||
{{#returnType}}result <- {{/returnType}}api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}})
|
{{#returnType}}result <- {{/returnType}}api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}})
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
dput(result)
|
dput(result)
|
||||||
|
@ -338,7 +338,9 @@ api_instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
|||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
# api_instance$GetPetByIdStreaming(var_pet_id, data_file = "result.txt"),
|
# api_instance$GetPetByIdStreaming(var_pet_id, data_file = "result.txt"),
|
||||||
api_instance$GetPetByIdStreaming(var_pet_id, stream_callback = function(x){ print(length(x)) }),
|
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||||
|
# api_instance$GetPetByIdStreaming(var_pet_id, stream_callback = function(x){ print(length(x)) }),
|
||||||
|
api_instance$GetPetByIdStreaming(var_pet_id),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
# In case of error, print the error object
|
# In case of error, print the error object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user