Compare commits

..

4 Commits

Author SHA1 Message Date
William Cheng
165549d099 update tests 2026-01-18 12:15:23 +08:00
William Cheng
2a31b78b1f update tests 2026-01-18 12:04:08 +08:00
William Cheng
7e620032a1 update tests 2026-01-18 11:57:05 +08:00
William Cheng
d3377590ee add more R samples for testing 2026-01-18 11:46:47 +08:00
46 changed files with 2489 additions and 5122 deletions

View File

@@ -13,7 +13,7 @@
"ghcr.io/snebjorn/devcontainer-feature/chromium:latest": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": false
"moby": true
}
},
// Configure tool-specific properties.

View File

@@ -1,69 +0,0 @@
name: Mill plugin tests
on:
push:
paths:
- modules/openapi-generator-mill-plugin/**
pull_request:
paths:
- modules/openapi-generator-mill-plugin/**
jobs:
test:
name: Mill plugin tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
java-version: 11
distribution: 'temurin'
- name: Restore cache (read-only)
# only use restore keys, no save key because we need to clear the cache before running the examples
uses: actions/cache/restore@v4
with:
path: |
~/.m2/repository
~/.gradle
~/.cache/coursier
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
!~/.cache/coursier/v1/https/repo1.maven.org/maven2/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Maven Clean Install
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
# This is needed because of differences in how Maven and Coursier download artifacts
# Maven will only download the pom when the transitive dependency is not needed in the current projects compile classpath
# whereas Coursier expects the artifact (jar) to be present in a Maven repository. When Coursier encounters a
# artifact folder with a pom it considers the artifact to be available and will then crash when the jar is missing.
- name: Clear m2 cache except openapitools (because otherwise coursier will fail to resolve artifacts where only poms are downloaded)
run: |
mv ~/.m2/repository/org/openapitools /tmp/openapitools-backup || true
rm -rf ~/.m2/repository/*
mkdir -p ~/.m2/repository/org
mv /tmp/openapitools-backup ~/.m2/repository/org/openapitools || true
- name: Mill Example - Test Validation Command
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
(cd modules/openapi-generator-mill-plugin/example/ && ./mill validateOpenapiSpec $(pwd)/api/petstore-invalid.yaml)
- name: Mill Example - Test Validation Task
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
(cd modules/openapi-generator-mill-plugin/example/ && ./mill openapi.validate)
- name: Mill Example - Test Compile Task
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
(cd modules/openapi-generator-mill-plugin/example/ && ./mill __.compile)

View File

@@ -93,7 +93,6 @@ declare -a xml_files=(
declare -a properties_files=(
"${root}/modules/openapi-generator-gradle-plugin/gradle.properties"
"${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties"
"${root}/modules/openapi-generator-mill-plugin/example/mill-build/version.properties"
)
${cwd}/bump.sh -f ${version} -i ${inc} ${xml_files[@]}

View File

@@ -1,36 +0,0 @@
import coursier.LocalRepositories.Dangerous
import coursier.Repositories
import mill.scalalib.DepSyntax
import mill.*
import mill.api.Task
import mill.meta.MillBuildRootModule
import java.util.Properties
import java.io.FileInputStream
import scala.util.Using
object `package` extends MillBuildRootModule {
override def repositories = Task {
Seq(
// central needed for default deps
Repositories.central.root,
// the previously installed snapshot is in local maven
// see docs on Coursier, why m2 is considered dangerous
Dangerous.maven2Local.root)
}
def propsFile = Task.Source("version.properties")
def readOpenapiSnapshotVersion: Task[String] = Task {
val props = new Properties()
Using(new FileInputStream(propsFile().path.toIO)) { fis =>
props.load(fis)
props.getProperty("openApiGeneratorVersion")
}.get
}
override def mvnDeps = Seq(
mvn"org.openapitools:openapi-generator-mill-plugin:${readOpenapiSnapshotVersion()}"
)
}

View File

@@ -1,3 +0,0 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.19.0-SNAPSHOT
# /RELEASE_VERSION

View File

@@ -0,0 +1,9 @@
To test the Mill plugin, this project can be used.
> ![NOTE]
> The `mill-build` folder is only needed to look up the plugin from the local Maven repository for development purposes.
It requires that the current SNAPSHOT version of the plugin is installed in the local Maven repository.
Replace the version in `build.mill` or set the environment variable `$MILL_OPENAPITOOLS_PLUGIN_VERSION` to the desired version.
Run `./mill __.compile` to test if the plugin works or some of the modules tasks like `./mill openapi.validate`.

View File

@@ -1,8 +1,7 @@
//| mill-version: 1.0.6
//| # usually you would add the plugin dependency like the following,
//| # but for testing with SNAPSHOT versions, the plugin dependency is added in the meta-build
//| # mvnDeps:
//| # - org.openapitools:openapi-generator-mill-plugin:$MILL_OPENAPITOOLS_PLUGIN_VERSION
//| mvnDeps:
//| - com.lihaoyi::mill-contrib-versionfile:$MILL_VERSION
//| - org.openapitools:openapi-generator-mill-plugin:$MILL_OPENAPITOOLS_PLUGIN_VERSION
//|
package build
@@ -13,12 +12,15 @@ import mill.scalalib.publish.PomSettings
import mill.util.BuildInfo.{millBinPlatform, millVersion}
import javalib.*
import mill.contrib.versionfile.VersionFileModule
import org.openapitools.generator.mill.OpenApiModule
object `package` extends JavaModule with MavenModule with OpenApiModule {
// dependency on openapi-generator is set in Mills meta-build
// this is needed to point to a local maven repo
override def mvnDeps = Seq(
mvn"jakarta.platform:jakarta.jakartaee-api:10.0.0",
mvn"jakarta.platform:jakarta.jakartaee-api:11.0.0",
mvn"com.fasterxml.jackson.core:jackson-databind:2.20.0",
mvn"org.openapitools:jackson-databind-nullable:0.2.8"
)

View File

@@ -0,0 +1,17 @@
import coursier.LocalRepositories.Dangerous
import coursier.Repositories
import mill.api.Task
import mill.meta.MillBuildRootModule
object `package` extends MillBuildRootModule {
override def repositories = Task {
Seq(
// central needed for default deps
Repositories.central.root,
// the previously installed snapshot is in local maven
// see docs on Coursier, why m2 is considered dangerous
Dangerous.maven2Local.root)
}
}

View File

@@ -0,0 +1 @@
7.16.0-SNAPSHOT

View File

@@ -4,8 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.web.client.RestClient
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestClient
import org.springframework.web.util.UriComponentsBuilder
import org.springframework.util.LinkedMultiValueMap
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ApiClient(protected val client: RestClient) {
@@ -35,12 +36,13 @@ import org.springframework.util.LinkedMultiValueMap
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
method(HttpMethod.valueOf(requestConfig.method.name))
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
uri(requestConfig.path) { builder ->
builder
.queryParams(LinkedMultiValueMap(requestConfig.query))
.build(requestConfig.params)
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>): RestClient.RequestBodySpec {
val uriComponentsBuilder = UriComponentsBuilder.fromPath(requestConfig.path)
requestConfig.query.forEach { key, values ->
uriComponentsBuilder.queryParam(key, "{$key}")
}
return uri(uriComponentsBuilder.encode().buildAndExpand(requestConfig.query + requestConfig.params).toUri())
}
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } }

View File

@@ -21,7 +21,7 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
{{/useJakartaEe}}
<junit.version>4.13.2</junit.version>
<vertx.version>4.5.24</vertx.version>
<vertx.version>4.5.22</vertx.version>
<maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
<vertx-openapi-router.version>1.0.2</vertx-openapi-router.version>
<maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>

View File

@@ -150,6 +150,7 @@
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
{{/vendorExtensions.x-streaming}}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
@@ -560,7 +561,7 @@
self$api_client$WriteFile(local_var_resp, data_file)
}
ApiResponse$new(content = content, response = resp, status_code = local_var_resp$status_code)
ApiResponse$new(content,resp)
{{/isPrimitiveType}}
{{^isPrimitiveType}}
# save response in a file
@@ -608,9 +609,7 @@
{{/useRlangExceptionHandling}}
{{/returnExceptionOnFailure}}
{{^returnExceptionOnFailure}}
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
{{/returnExceptionOnFailure}}
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
{{#returnExceptionOnFailure}}
@@ -627,9 +626,7 @@
{{/useRlangExceptionHandling}}
{{/returnExceptionOnFailure}}
{{^returnExceptionOnFailure}}
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
{{/returnExceptionOnFailure}}
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
{{#returnExceptionOnFailure}}
@@ -646,7 +643,7 @@
{{/useRlangExceptionHandling}}
{{/returnExceptionOnFailure}}
{{^returnExceptionOnFailure}}
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -351,11 +351,6 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -364,10 +359,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
inner_return_type <- regmatches(return_type,
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -376,9 +371,6 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -363,11 +363,6 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -376,10 +371,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
inner_return_type <- regmatches(return_type,
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -388,9 +383,6 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -30,6 +30,9 @@
stop("Use one of the valid values: ",
paste0(enumvec, collapse = ", "))
}
warning("Initializing {{{classname}}} with DUMMY_ENUM. Use one of the valid values: ",
paste0(enumvec, collapse = ", "),
". If you did not manually initialize {{{classname}}}, this may already be overwritten by an enum loaded from a JSON config.")
}
private$value <- val
},

View File

@@ -1265,7 +1265,7 @@
<snakeyaml.version>2.4</snakeyaml.version>
<spotbugs-plugin.version>3.1.12.2</spotbugs-plugin.version>
<swagger-parser-groupid.version>io.swagger.parser.v3</swagger-parser-groupid.version>
<swagger-parser.version>2.1.37</swagger-parser.version>
<swagger-parser.version>2.1.36</swagger-parser.version>
<testng.version>7.10.2</testng.version>
<violations-maven-plugin.version>1.34</violations-maven-plugin.version>
<wagon-ssh-external.version>3.4.3</wagon-ssh-external.version>

View File

@@ -4,8 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.web.client.RestClient
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestClient
import org.springframework.web.util.UriComponentsBuilder
import org.springframework.util.LinkedMultiValueMap
open class ApiClient(protected val client: RestClient) {
@@ -35,12 +36,13 @@ open class ApiClient(protected val client: RestClient) {
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
method(HttpMethod.valueOf(requestConfig.method.name))
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
uri(requestConfig.path) { builder ->
builder
.queryParams(LinkedMultiValueMap(requestConfig.query))
.build(requestConfig.params)
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>): RestClient.RequestBodySpec {
val uriComponentsBuilder = UriComponentsBuilder.fromPath(requestConfig.path)
requestConfig.query.forEach { key, values ->
uriComponentsBuilder.queryParam(key, "{$key}")
}
return uri(uriComponentsBuilder.encode().buildAndExpand(requestConfig.query + requestConfig.params).toUri())
}
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } }

View File

@@ -303,11 +303,6 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -316,10 +311,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
inner_return_type <- regmatches(return_type,
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -328,9 +323,6 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -148,15 +148,11 @@ AuthApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -243,15 +239,11 @@ AuthApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -250,15 +250,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -353,15 +349,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -455,15 +447,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -553,15 +541,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -656,15 +640,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -759,15 +739,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -862,15 +838,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -965,15 +937,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1068,15 +1036,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1171,15 +1135,11 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -181,15 +181,11 @@ FormApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -283,15 +279,11 @@ FormApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -416,15 +408,11 @@ FormApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -169,15 +169,11 @@ HeaderApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -184,15 +184,11 @@ PathApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -290,15 +290,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -405,15 +401,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -520,15 +512,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -619,15 +607,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -718,15 +702,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -818,15 +798,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -918,15 +894,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1017,15 +989,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1116,15 +1084,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1215,15 +1179,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1323,15 +1283,11 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
ApiResponse$new("API client error", local_var_resp)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -29,6 +29,9 @@ StringEnumRef <- R6::R6Class(
stop("Use one of the valid values: ",
paste0(enumvec, collapse = ", "))
}
warning("Initializing StringEnumRef with DUMMY_ENUM. Use one of the valid values: ",
paste0(enumvec, collapse = ", "),
". If you did not manually initialize StringEnumRef, this may already be overwritten by an enum loaded from a JSON config.")
}
private$value <- val
},

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,7 @@
},
"devDependencies": {
"@angular/build": "^20.3.1",
"@angular/cli": "^21.1.0",
"@angular/cli": "^20.3.13",
"@angular/compiler-cli": "^20.3.0",
"@types/jasmine": "~5.1.8",
"jasmine-core": "~5.10.0",

View File

@@ -352,11 +352,6 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -365,10 +360,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
inner_return_type <- regmatches(return_type,
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -377,9 +372,6 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -1028,6 +1028,7 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
@@ -1164,6 +1165,7 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {

View File

@@ -352,11 +352,6 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -365,10 +360,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
inner_return_type <- regmatches(return_type,
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -377,9 +372,6 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -1028,6 +1028,7 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
@@ -1164,6 +1165,7 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {

View File

@@ -332,11 +332,6 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -345,10 +340,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
inner_return_type <- regmatches(return_type,
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -357,9 +352,6 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -1028,6 +1028,7 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
@@ -1164,6 +1165,7 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {

View File

@@ -4,8 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.web.client.RestClient
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestClient
import org.springframework.web.util.UriComponentsBuilder
import org.springframework.util.LinkedMultiValueMap
open class ApiClient(protected val client: RestClient) {
@@ -35,12 +36,13 @@ open class ApiClient(protected val client: RestClient) {
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
method(HttpMethod.valueOf(requestConfig.method.name))
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
uri(requestConfig.path) { builder ->
builder
.queryParams(LinkedMultiValueMap(requestConfig.query))
.build(requestConfig.params)
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>): RestClient.RequestBodySpec {
val uriComponentsBuilder = UriComponentsBuilder.fromPath(requestConfig.path)
requestConfig.query.forEach { key, values ->
uriComponentsBuilder.queryParam(key, "{$key}")
}
return uri(uriComponentsBuilder.encode().buildAndExpand(requestConfig.query + requestConfig.params).toUri())
}
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } }

View File

@@ -26,7 +26,7 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^19.2.17",
"@angular/cli": "^21.1.0",
"@angular/cli": "^19.0.0",
"@angular/compiler-cli": "^19.0.0",
"@angular/language-service": "^19.0.0",
"@types/jasmine": "~4.3.4",

View File

@@ -10,7 +10,7 @@
"dependencies": {
"@angular/animations": "^19.0.0",
"@angular/common": "^19.0.0",
"@angular/compiler": "^19.2.18",
"@angular/compiler": "^19.2.17",
"@angular/core": "^19.0.0",
"@angular/forms": "^19.0.0",
"@angular/platform-browser": "^19.0.0",
@@ -1180,9 +1180,9 @@
}
},
"node_modules/@angular/compiler": {
"version": "19.2.18",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-19.2.18.tgz",
"integrity": "sha512-3MscvODxRVxc3Cs0ZlHI5Pk5rEvE80otfvxZTMksOZuPlv1B+S8MjWfc3X3jk9SbyUEzODBEH55iCaBHD48V3g==",
"version": "19.2.17",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-19.2.17.tgz",
"integrity": "sha512-qo8psYASAlDiQ8fAL8i/E2JfWH2nPTpZDKKZxSWvgBVA8o+zUEjYAJu6/k6btnu+4Qcb425T0rmM/zao6EU9Aw==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
@@ -10478,9 +10478,9 @@
}
},
"node_modules/listr2/node_modules/ansi-regex": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -10491,9 +10491,9 @@
}
},
"node_modules/listr2/node_modules/ansi-styles": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"dev": true,
"license": "MIT",
"engines": {
@@ -10511,9 +10511,9 @@
"license": "MIT"
},
"node_modules/listr2/node_modules/strip-ansi": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
"integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -10527,9 +10527,9 @@
}
},
"node_modules/listr2/node_modules/wrap-ansi": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",
"integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz",
"integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -11251,9 +11251,9 @@
"license": "MIT"
},
"node_modules/msgpackr": {
"version": "1.11.8",
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.8.tgz",
"integrity": "sha512-bC4UGzHhVvgDNS7kn9tV8fAucIYUBuGojcaLiz7v+P63Lmtm0Xeji8B/8tYKddALXxJLpwIeBmUN3u64C4YkRA==",
"version": "1.11.5",
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.5.tgz",
"integrity": "sha512-UjkUHN0yqp9RWKy0Lplhh+wlpdt9oQBYgULZOiFhV3VclSF1JnSQWZ5r9gORQlNYaUKQoR8itv7g7z1xDDuACA==",
"dev": true,
"license": "MIT",
"optional": true,
@@ -11792,9 +11792,9 @@
"license": "ISC"
},
"node_modules/ordered-binary": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/ordered-binary/-/ordered-binary-1.6.1.tgz",
"integrity": "sha512-QkCdPooczexPLiXIrbVOPYkR3VO3T6v2OyKRkR1Xbhpy7/LAVXwahnRCgRp78Oe/Ehf0C/HATAxfSr6eA1oX+w==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ordered-binary/-/ordered-binary-1.6.0.tgz",
"integrity": "sha512-IQh2aMfMIDbPjI/8a3Edr+PiOpcsB7yo8NdW7aHWVaoR/pcDldunMvnnwbk/auPGqmKeAdxtZl7MHX/QmPwhvQ==",
"dev": true,
"license": "MIT",
"optional": true
@@ -13424,9 +13424,9 @@
}
},
"node_modules/slice-ansi/node_modules/ansi-styles": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"dev": true,
"license": "MIT",
"engines": {

View File

@@ -12,7 +12,7 @@
"dependencies": {
"@angular/animations": "^19.0.0",
"@angular/common": "^19.0.0",
"@angular/compiler": "^19.2.18",
"@angular/compiler": "^19.2.17",
"@angular/core": "^19.0.0",
"@angular/forms": "^19.0.0",
"@angular/platform-browser": "^19.0.0",

View File

@@ -16710,9 +16710,9 @@
}
},
"node_modules/tar": {
"version": "7.5.3",
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.3.tgz",
"integrity": "sha512-ENg5JUHUm2rDD7IvKNFGzyElLXNjachNLp6RaGf4+JOgxXHkqA+gq81ZAMCUmtMtqBsoU62lcp6S27g1LCYGGQ==",
"version": "7.5.2",
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.2.tgz",
"integrity": "sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {

View File

@@ -16,7 +16,7 @@
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit.version>4.13.2</junit.version>
<vertx.version>4.5.24</vertx.version>
<vertx.version>4.5.22</vertx.version>
<maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
<vertx-openapi-router.version>1.0.2</vertx-openapi-router.version>
<maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>

View File

@@ -16,7 +16,7 @@
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit.version>4.13.2</junit.version>
<vertx.version>4.5.24</vertx.version>
<vertx.version>4.5.22</vertx.version>
<maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
<vertx-openapi-router.version>1.0.2</vertx-openapi-router.version>
<maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>