From 884a74550a7d7f7b901ea9a7067c71f8650a0fd2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 10 May 2022 17:23:13 +0800 Subject: [PATCH] add tests to set httpUserAgent in r client (#12321) --- bin/configs/r-client.yaml | 1 + samples/client/petstore/R/R/api_client.R | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/configs/r-client.yaml b/bin/configs/r-client.yaml index 1de2699e1d95..98a79ecb29ef 100644 --- a/bin/configs/r-client.yaml +++ b/bin/configs/r-client.yaml @@ -2,5 +2,6 @@ generatorName: r outputDir: samples/client/petstore/R inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/r +httpUserAgent: PetstoreAgent additionalProperties: packageName: petstore diff --git a/samples/client/petstore/R/R/api_client.R b/samples/client/petstore/R/R/api_client.R index 52ede81af0d0..533e8ea9daed 100644 --- a/samples/client/petstore/R/R/api_client.R +++ b/samples/client/petstore/R/R/api_client.R @@ -41,7 +41,7 @@ ApiClient <- R6::R6Class( # base path of all requests basePath = "http://petstore.swagger.io/v2", # user agent in the HTTP request - userAgent = "OpenAPI-Generator/1.0.0/r", + userAgent = "PetstoreAgent", # default headers in the HTTP request defaultHeaders = NULL, # username (HTTP basic authentication)