[R] fix assignment, better doc (#12979)

* better code format

* fix doc comment, remove blank line

* ignore .lintr in rbuildignore
This commit is contained in:
William Cheng 2022-07-22 13:08:01 +08:00 committed by GitHub
parent 0ce606c7c5
commit e4b268613c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 109 additions and 129 deletions

View File

@ -11,6 +11,7 @@
^\.gitignore$
^\.openapi-generator-ignore$
^\.travis\.yml$
^\.lintr$
^\.github$
^\.openapi-generator$
^docs$

View File

@ -12,7 +12,7 @@
{{#operation}}
#' \strong{ {{operationId}} } \emph{ {{summary}} }
{{#notes}}
#' {{notes}}
#' {{{.}}}
{{/notes}}
#'
#' \itemize{
@ -182,7 +182,7 @@
#' @param {{{paramName}}} {{{description}}}
{{/requiredParams}}
{{#optionalParams}}
#' @param {{{paramName}}} (optional){{{description}}} {{#defaultValue}} (default value: {{{.}}}){{/defaultValue}}
#' @param {{{paramName}}} (optional) {{{description}}}{{^description}}No description{{/description}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}}
{{/optionalParams}}
{{#vendorExtensions.x-streaming}}
#' @param stream_callback (optional) callback function to process the data stream
@ -221,7 +221,7 @@
#' @param {{{paramName}}} {{{description}}}
{{/requiredParams}}
{{#optionalParams}}
#' @param {{{paramName}}} (optional) {{{description}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}}
#' @param {{{paramName}}} (optional) {{{description}}}{{^description}}No description{{/description}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}}
{{/optionalParams}}
{{#vendorExtensions.x-streaming}}
#' @param stream_callback (optional) callback function to process the data stream
@ -276,7 +276,9 @@
{{#bodyParams}}
if (!missing(`{{paramName}}`)) {
{{#isArray}}
body.items = paste(unlist(lapply({{paramName}}, function(param) {param$toJSONString()})), collapse = ",")
body.items <- paste(unlist(lapply({{paramName}}, function(param) {
param$toJSONString()
})), collapse = ",")
body <- paste0("[", body.items, "]")
{{/isArray}}
{{^isArray}}

View File

@ -1,5 +1,3 @@
{{#models}}
{{#model}}
#' @docType class
#' @title {{classname}}
#' @description {{classname}} Class
@ -9,10 +7,6 @@
{{/vars}}
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
{{#isEnum}}
{{>modelEnum}}
{{/isEnum}}
{{^isEnum}}
#' @export
{{classname}} <- R6::R6Class(
"{{classname}}",
@ -363,6 +357,3 @@
}
)
)
{{/isEnum}}
{{/model}}
{{/models}}

View File

@ -11,6 +11,7 @@
^\.gitignore$
^\.openapi-generator-ignore$
^\.travis\.yml$
^\.lintr$
^\.github$
^\.openapi-generator$
^docs$

View File

@ -213,4 +213,3 @@ AllofTagApiResponse <- R6::R6Class(
}
)
)

View File

@ -150,4 +150,3 @@ Animal <- R6::R6Class(
}
)
)

View File

@ -155,4 +155,3 @@ AnyOfPig <- R6::R6Class(
}
)
)

View File

@ -156,4 +156,3 @@ BasquePig <- R6::R6Class(
}
)
)

View File

@ -174,4 +174,3 @@ Cat <- R6::R6Class(
}
)
)

View File

@ -121,4 +121,3 @@ CatAllOf <- R6::R6Class(
}
)
)

View File

@ -144,4 +144,3 @@ Category <- R6::R6Class(
}
)
)

View File

@ -156,4 +156,3 @@ DanishPig <- R6::R6Class(
}
)
)

View File

@ -174,4 +174,3 @@ Dog <- R6::R6Class(
}
)
)

View File

@ -121,4 +121,3 @@ DogAllOf <- R6::R6Class(
}
)
)

View File

@ -167,4 +167,3 @@ ModelApiResponse <- R6::R6Class(
}
)
)

View File

@ -146,4 +146,3 @@ NestedOneOf <- R6::R6Class(
}
)
)

View File

@ -236,4 +236,3 @@ Order <- R6::R6Class(
}
)
)

View File

@ -253,4 +253,3 @@ Pet <- R6::R6Class(
}
)
)

View File

@ -642,7 +642,7 @@ PetApi <- R6::R6Class(
#' Deletes a pet
#'
#' @param pet_id Pet id to delete
#' @param api_key (optional)
#' @param api_key (optional) No description
#' @param ... Other optional arguments
#' @return void
#' @export
@ -665,7 +665,7 @@ PetApi <- R6::R6Class(
#' Deletes a pet
#'
#' @param pet_id Pet id to delete
#' @param api_key (optional)
#' @param api_key (optional) No description
#' @param ... Other optional arguments
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export

View File

@ -171,4 +171,3 @@ Pig <- R6::R6Class(
}
)
)

View File

@ -236,4 +236,3 @@ Special <- R6::R6Class(
}
)
)

View File

@ -15,7 +15,7 @@
#' @section Methods:
#' \describe{
#' \strong{ DeleteOrder } \emph{ Delete purchase order by ID }
#' For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
#'
#' \itemize{
#' \item \emph{ @param } order_id character
@ -55,7 +55,7 @@
#' }
#'
#' \strong{ GetOrderById } \emph{ Find purchase order by ID }
#' For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
#' For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
#'
#' \itemize{
#' \item \emph{ @param } order_id integer

View File

@ -144,4 +144,3 @@ Tag <- R6::R6Class(
}
)
)

View File

@ -145,4 +145,3 @@ UpdatePetRequest <- R6::R6Class(
}
)
)

View File

@ -282,4 +282,3 @@ User <- R6::R6Class(
}
)
)

View File

@ -559,7 +559,9 @@ UserApi <- R6::R6Class(
}
if (!missing(`user`)) {
body.items = paste(unlist(lapply(user, function(param) {param$toJSONString()})), collapse = ",")
body.items <- paste(unlist(lapply(user, function(param) {
param$toJSONString()
})), collapse = ",")
body <- paste0("[", body.items, "]")
} else {
body <- NULL
@ -650,7 +652,9 @@ UserApi <- R6::R6Class(
}
if (!missing(`user`)) {
body.items = paste(unlist(lapply(user, function(param) {param$toJSONString()})), collapse = ",")
body.items <- paste(unlist(lapply(user, function(param) {
param$toJSONString()
})), collapse = ",")
body <- paste0("[", body.items, "]")
} else {
body <- NULL