forked from loafle/openapi-generator-original
[BUG][CLI][GENERATOR] NullPointer when not setting outputDir (updated) (#3752)
* Fixes NPE when no outputDir is set * Fix behaviors of default values for values not provided by user * Easier handling of default behavior in settings. * Fixes for dynamic config deserialization (specifically, ruby client sample fix) * Tests for WorkflowSettings (defaults, modified defaults, nulls) * Test modification of WorkflowSettings defaults for both class constructor and builder
This commit is contained in:
@@ -2,5 +2,6 @@
|
||||
"gemName": "petstore",
|
||||
"moduleName": "Petstore",
|
||||
"library": "faraday",
|
||||
"gemVersion": "1.0.0"
|
||||
"gemVersion": "1.0.0",
|
||||
"strictSpecBehavior": false
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"gemName": "petstore",
|
||||
"library": "typhoeus",
|
||||
"moduleName": "Petstore",
|
||||
"gemVersion": "1.0.0"
|
||||
"gemVersion": "1.0.0",
|
||||
"strictSpecBehavior": false
|
||||
}
|
||||
|
||||
@@ -421,13 +421,27 @@ public final class GeneratorSettings implements Serializable {
|
||||
builder.artifactId = copy.getArtifactId();
|
||||
builder.artifactVersion = copy.getArtifactVersion();
|
||||
builder.library = copy.getLibrary();
|
||||
builder.instantiationTypes = new HashMap<>(copy.getInstantiationTypes());
|
||||
builder.typeMappings = new HashMap<>(copy.getTypeMappings());
|
||||
builder.additionalProperties = new HashMap<>(copy.getAdditionalProperties());
|
||||
builder.importMappings = new HashMap<>(copy.getImportMappings());
|
||||
builder.languageSpecificPrimitives = new HashSet<>(copy.getLanguageSpecificPrimitives());
|
||||
builder.reservedWordMappings = new HashMap<>(copy.getReservedWordMappings());
|
||||
builder.serverVariables = new HashMap<>(copy.getServerVariables());
|
||||
if (copy.getInstantiationTypes() != null) {
|
||||
builder.instantiationTypes.putAll(copy.getInstantiationTypes());
|
||||
}
|
||||
if (copy.getTypeMappings() != null) {
|
||||
builder.typeMappings.putAll(copy.getTypeMappings());
|
||||
}
|
||||
if (copy.getAdditionalProperties() != null) {
|
||||
builder.additionalProperties.putAll(copy.getAdditionalProperties());
|
||||
}
|
||||
if (copy.getImportMappings() != null) {
|
||||
builder.importMappings.putAll(copy.getImportMappings());
|
||||
}
|
||||
if (copy.getLanguageSpecificPrimitives() != null) {
|
||||
builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives());
|
||||
}
|
||||
if (copy.getReservedWordMappings() != null) {
|
||||
builder.reservedWordMappings.putAll(copy.getReservedWordMappings());
|
||||
}
|
||||
if (copy.getServerVariables() != null) {
|
||||
builder.serverVariables.putAll(copy.getServerVariables());
|
||||
}
|
||||
builder.gitUserId = copy.getGitUserId();
|
||||
builder.gitRepoId = copy.getGitRepoId();
|
||||
builder.releaseNote = copy.getReleaseNote();
|
||||
|
||||
@@ -33,38 +33,48 @@ import java.util.Objects;
|
||||
public class WorkflowSettings {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowSettings.class);
|
||||
public static final String DEFAULT_OUTPUT_DIR = ".";
|
||||
public static final boolean DEFAULT_VERBOSE = false;
|
||||
public static final boolean DEFAULT_SKIP_OVERWRITE = false;
|
||||
public static final boolean DEFAULT_REMOVE_OPERATION_ID_PREFIX = false;
|
||||
public static final boolean DEFAULT_LOG_TO_STDERR = false;
|
||||
public static final boolean DEFAULT_VALIDATE_SPEC = true;
|
||||
public static final boolean DEFAULT_ENABLE_POST_PROCESS_FILE = false;
|
||||
public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false;
|
||||
public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true;
|
||||
public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache";
|
||||
public static final ImmutableMap<String, String> DEFAULT_SYSTEM_PROPERTIES = ImmutableMap.of();
|
||||
|
||||
private String inputSpec;
|
||||
private String outputDir;
|
||||
private boolean verbose;
|
||||
private boolean skipOverwrite;
|
||||
private boolean removeOperationIdPrefix;
|
||||
private boolean logToStderr;
|
||||
private boolean validateSpec;
|
||||
private boolean enablePostProcessFile;
|
||||
private boolean enableMinimalUpdate;
|
||||
private boolean strictSpecBehavior;
|
||||
private String outputDir = DEFAULT_OUTPUT_DIR;
|
||||
private boolean verbose = DEFAULT_VERBOSE;
|
||||
private boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE;
|
||||
private boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX;
|
||||
private boolean logToStderr = DEFAULT_LOG_TO_STDERR;
|
||||
private boolean validateSpec = DEFAULT_VALIDATE_SPEC;
|
||||
private boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE;
|
||||
private boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE;
|
||||
private boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR;
|
||||
private String templateDir;
|
||||
private String templatingEngineName;
|
||||
private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME;
|
||||
private String ignoreFileOverride;
|
||||
private ImmutableMap<String, String> systemProperties;
|
||||
private ImmutableMap<String, String> systemProperties = DEFAULT_SYSTEM_PROPERTIES;
|
||||
|
||||
private WorkflowSettings(Builder builder) {
|
||||
setDefaults();
|
||||
inputSpec = builder.inputSpec;
|
||||
outputDir = builder.outputDir;
|
||||
verbose = builder.verbose;
|
||||
skipOverwrite = builder.skipOverwrite;
|
||||
removeOperationIdPrefix = builder.removeOperationIdPrefix;
|
||||
logToStderr = builder.logToStderr;
|
||||
validateSpec = builder.validateSpec;
|
||||
enablePostProcessFile = builder.enablePostProcessFile;
|
||||
enableMinimalUpdate = builder.enableMinimalUpdate;
|
||||
strictSpecBehavior = builder.strictSpecBehavior;
|
||||
templateDir = builder.templateDir;
|
||||
templatingEngineName = builder.templatingEngineName;
|
||||
ignoreFileOverride = builder.ignoreFileOverride;
|
||||
systemProperties = ImmutableMap.copyOf(builder.systemProperties);
|
||||
this.inputSpec = builder.inputSpec;
|
||||
this.outputDir = builder.outputDir;
|
||||
this.verbose = builder.verbose;
|
||||
this.skipOverwrite = builder.skipOverwrite;
|
||||
this.removeOperationIdPrefix = builder.removeOperationIdPrefix;
|
||||
this.logToStderr = builder.logToStderr;
|
||||
this.validateSpec = builder.validateSpec;
|
||||
this.enablePostProcessFile = builder.enablePostProcessFile;
|
||||
this.enableMinimalUpdate = builder.enableMinimalUpdate;
|
||||
this.strictSpecBehavior = builder.strictSpecBehavior;
|
||||
this.templateDir = builder.templateDir;
|
||||
this.templatingEngineName = builder.templatingEngineName;
|
||||
this.ignoreFileOverride = builder.ignoreFileOverride;
|
||||
this.systemProperties = ImmutableMap.copyOf(builder.systemProperties);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,14 +82,7 @@ public class WorkflowSettings {
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public WorkflowSettings() {
|
||||
setDefaults();
|
||||
systemProperties = ImmutableMap.of();
|
||||
}
|
||||
|
||||
private void setDefaults(){
|
||||
validateSpec = true;
|
||||
strictSpecBehavior = true;
|
||||
outputDir = ".";
|
||||
}
|
||||
|
||||
public static Builder newBuilder() {
|
||||
@@ -257,24 +260,24 @@ public class WorkflowSettings {
|
||||
@SuppressWarnings("unused")
|
||||
public static final class Builder {
|
||||
private String inputSpec;
|
||||
private String outputDir;
|
||||
private boolean verbose;
|
||||
private boolean skipOverwrite;
|
||||
private boolean removeOperationIdPrefix;
|
||||
private boolean logToStderr;
|
||||
private boolean validateSpec;
|
||||
private boolean enablePostProcessFile;
|
||||
private boolean enableMinimalUpdate;
|
||||
private boolean strictSpecBehavior;
|
||||
private String outputDir = DEFAULT_OUTPUT_DIR;
|
||||
private Boolean verbose = DEFAULT_VERBOSE;
|
||||
private Boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE;
|
||||
private Boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX;
|
||||
private Boolean logToStderr = DEFAULT_LOG_TO_STDERR;
|
||||
private Boolean validateSpec = DEFAULT_VALIDATE_SPEC;
|
||||
private Boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE;
|
||||
private Boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE;
|
||||
private Boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR;
|
||||
private String templateDir;
|
||||
private String templatingEngineName;
|
||||
private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME;
|
||||
private String ignoreFileOverride;
|
||||
private Map<String, String> systemProperties;
|
||||
private Map<String, String> systemProperties = new HashMap<>();;
|
||||
|
||||
private Builder() {
|
||||
systemProperties = new HashMap<>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the {@code inputSpec} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
@@ -282,7 +285,9 @@ public class WorkflowSettings {
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withInputSpec(String inputSpec) {
|
||||
if (inputSpec != null) {
|
||||
this.inputSpec = inputSpec;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -293,7 +298,11 @@ public class WorkflowSettings {
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withOutputDir(String outputDir) {
|
||||
this.outputDir = Paths.get(outputDir).toAbsolutePath().toString();;
|
||||
if (outputDir != null ) {
|
||||
this.outputDir = Paths.get(outputDir).toAbsolutePath().toString();
|
||||
} else {
|
||||
this.outputDir = DEFAULT_OUTPUT_DIR;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -303,8 +312,8 @@ public class WorkflowSettings {
|
||||
* @param verbose the {@code verbose} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withVerbose(boolean verbose) {
|
||||
this.verbose = verbose;
|
||||
public Builder withVerbose(Boolean verbose) {
|
||||
this.verbose = verbose != null ? verbose : Boolean.valueOf(DEFAULT_VERBOSE);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -314,8 +323,8 @@ public class WorkflowSettings {
|
||||
* @param skipOverwrite the {@code skipOverwrite} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withSkipOverwrite(boolean skipOverwrite) {
|
||||
this.skipOverwrite = skipOverwrite;
|
||||
public Builder withSkipOverwrite(Boolean skipOverwrite) {
|
||||
this.skipOverwrite = skipOverwrite != null ? skipOverwrite : Boolean.valueOf(DEFAULT_SKIP_OVERWRITE);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -325,8 +334,8 @@ public class WorkflowSettings {
|
||||
* @param removeOperationIdPrefix the {@code removeOperationIdPrefix} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withRemoveOperationIdPrefix(boolean removeOperationIdPrefix) {
|
||||
this.removeOperationIdPrefix = removeOperationIdPrefix;
|
||||
public Builder withRemoveOperationIdPrefix(Boolean removeOperationIdPrefix) {
|
||||
this.removeOperationIdPrefix = removeOperationIdPrefix != null ? removeOperationIdPrefix : Boolean.valueOf(DEFAULT_REMOVE_OPERATION_ID_PREFIX);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -336,8 +345,8 @@ public class WorkflowSettings {
|
||||
* @param logToStderr the {@code logToStderr} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withLogToStderr(boolean logToStderr) {
|
||||
this.logToStderr = logToStderr;
|
||||
public Builder withLogToStderr(Boolean logToStderr) {
|
||||
this.logToStderr = logToStderr != null ? logToStderr : Boolean.valueOf(DEFAULT_LOG_TO_STDERR);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -347,8 +356,8 @@ public class WorkflowSettings {
|
||||
* @param validateSpec the {@code validateSpec} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withValidateSpec(boolean validateSpec) {
|
||||
this.validateSpec = validateSpec;
|
||||
public Builder withValidateSpec(Boolean validateSpec) {
|
||||
this.validateSpec = validateSpec != null ? validateSpec : Boolean.valueOf(DEFAULT_VALIDATE_SPEC);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -358,8 +367,8 @@ public class WorkflowSettings {
|
||||
* @param enablePostProcessFile the {@code enablePostProcessFile} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withEnablePostProcessFile(boolean enablePostProcessFile) {
|
||||
this.enablePostProcessFile = enablePostProcessFile;
|
||||
public Builder withEnablePostProcessFile(Boolean enablePostProcessFile) {
|
||||
this.enablePostProcessFile = enablePostProcessFile != null ? enablePostProcessFile : Boolean.valueOf(DEFAULT_ENABLE_POST_PROCESS_FILE);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -369,8 +378,8 @@ public class WorkflowSettings {
|
||||
* @param enableMinimalUpdate the {@code enableMinimalUpdate} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withEnableMinimalUpdate(boolean enableMinimalUpdate) {
|
||||
this.enableMinimalUpdate = enableMinimalUpdate;
|
||||
public Builder withEnableMinimalUpdate(Boolean enableMinimalUpdate) {
|
||||
this.enableMinimalUpdate = enableMinimalUpdate != null ? enableMinimalUpdate : Boolean.valueOf(DEFAULT_ENABLE_MINIMAL_UPDATE);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -380,8 +389,8 @@ public class WorkflowSettings {
|
||||
* @param strictSpecBehavior the {@code strictSpecBehavior} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withStrictSpecBehavior(boolean strictSpecBehavior) {
|
||||
this.strictSpecBehavior = strictSpecBehavior;
|
||||
public Builder withStrictSpecBehavior(Boolean strictSpecBehavior) {
|
||||
this.strictSpecBehavior = strictSpecBehavior != null ? strictSpecBehavior : Boolean.valueOf(DEFAULT_STRICT_SPEC_BEHAVIOR);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -392,9 +401,7 @@ public class WorkflowSettings {
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withTemplateDir(String templateDir) {
|
||||
if (templateDir == null) {
|
||||
this.templateDir = null;
|
||||
} else {
|
||||
if (templateDir != null) {
|
||||
File f = new File(templateDir);
|
||||
|
||||
// check to see if the folder exists
|
||||
@@ -416,7 +423,7 @@ public class WorkflowSettings {
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withTemplatingEngineName(String templatingEngineName) {
|
||||
this.templatingEngineName = templatingEngineName;
|
||||
this.templatingEngineName = templatingEngineName != null ? templatingEngineName : DEFAULT_TEMPLATING_ENGINE_NAME;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -438,7 +445,9 @@ public class WorkflowSettings {
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withSystemProperties(Map<String, String> systemProperties) {
|
||||
if (systemProperties != null) {
|
||||
this.systemProperties = systemProperties;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.openapitools.codegen.config;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
public class WorkflowSettingsTest {
|
||||
@Test
|
||||
public void defaultValuesNotOverriddenByNulls(){
|
||||
WorkflowSettings settings = WorkflowSettings.newBuilder()
|
||||
.withOutputDir(null)
|
||||
.withVerbose(null)
|
||||
.withSkipOverwrite(null)
|
||||
.withRemoveOperationIdPrefix(null)
|
||||
.withLogToStderr(null)
|
||||
.withValidateSpec(null)
|
||||
.withEnablePostProcessFile(null)
|
||||
.withEnableMinimalUpdate(null)
|
||||
.withStrictSpecBehavior(null)
|
||||
.build();
|
||||
|
||||
assertEquals(settings.getOutputDir(), ".");
|
||||
assertFalse(settings.isVerbose());
|
||||
assertFalse(settings.isSkipOverwrite());
|
||||
assertFalse(settings.isRemoveOperationIdPrefix());
|
||||
assertFalse(settings.isLogToStderr());
|
||||
assertTrue(settings.isValidateSpec());
|
||||
assertFalse(settings.isEnablePostProcessFile());
|
||||
assertFalse(settings.isEnableMinimalUpdate());
|
||||
assertTrue(settings.isStrictSpecBehavior());
|
||||
}
|
||||
|
||||
private void assertOnChangesToDefaults(WorkflowSettings defaults) {
|
||||
WorkflowSettings settings = WorkflowSettings.newBuilder()
|
||||
.withOutputDir("output")
|
||||
.withVerbose(true)
|
||||
.withSkipOverwrite(true)
|
||||
.withRemoveOperationIdPrefix(true)
|
||||
.withLogToStderr(true)
|
||||
.withValidateSpec(false)
|
||||
.withEnablePostProcessFile(true)
|
||||
.withEnableMinimalUpdate(true)
|
||||
.withStrictSpecBehavior(false)
|
||||
.build();
|
||||
|
||||
assertNotEquals(defaults.getOutputDir(), settings.getOutputDir());
|
||||
assertEquals(settings.getOutputDir(), Paths.get("output").toAbsolutePath().toString());
|
||||
|
||||
assertNotEquals(defaults.isVerbose(), settings.isVerbose());
|
||||
assertTrue(settings.isVerbose());
|
||||
|
||||
assertNotEquals(defaults.isSkipOverwrite(), settings.isSkipOverwrite());
|
||||
assertTrue(settings.isSkipOverwrite());
|
||||
|
||||
assertNotEquals(defaults.isRemoveOperationIdPrefix(), settings.isRemoveOperationIdPrefix());
|
||||
assertTrue(settings.isRemoveOperationIdPrefix());
|
||||
|
||||
assertNotEquals(defaults.isLogToStderr(), settings.isLogToStderr());
|
||||
assertTrue(settings.isLogToStderr());
|
||||
|
||||
assertNotEquals(defaults.isValidateSpec(), settings.isValidateSpec());
|
||||
assertFalse(settings.isValidateSpec());
|
||||
|
||||
assertNotEquals(defaults.isEnablePostProcessFile(), settings.isEnablePostProcessFile());
|
||||
assertTrue(settings.isEnablePostProcessFile());
|
||||
|
||||
assertNotEquals(defaults.isEnableMinimalUpdate(), settings.isEnableMinimalUpdate());
|
||||
assertTrue(settings.isEnableMinimalUpdate());
|
||||
|
||||
assertNotEquals(defaults.isStrictSpecBehavior(), settings.isStrictSpecBehavior());
|
||||
assertFalse(settings.isStrictSpecBehavior());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultValuesCanBeChangedClassConstructor(){
|
||||
WorkflowSettings defaults = new WorkflowSettings();
|
||||
assertOnChangesToDefaults(defaults);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultValuesCanBeChangedBuilder(){
|
||||
WorkflowSettings defaults = WorkflowSettings.newBuilder().build();
|
||||
assertOnChangesToDefaults(defaults);
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,7 @@ public class CodegenConfigurator {
|
||||
DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class);
|
||||
CodegenConfigurator configurator = new CodegenConfigurator();
|
||||
configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(settings.getGeneratorSettings());
|
||||
configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(settings.getWorkflowSettings());
|
||||
return configurator;
|
||||
} catch (IOException ex) {
|
||||
LOGGER.error("Unable to deserialize config file: " + configFile, ex);
|
||||
|
||||
@@ -1 +1 @@
|
||||
4.1.0-SNAPSHOT
|
||||
4.1.1-SNAPSHOT
|
||||
@@ -89,6 +89,7 @@ Class | Method | HTTP request | Description
|
||||
*Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
|
||||
*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
|
||||
@@ -17,6 +17,7 @@ Method | HTTP request | Description
|
||||
[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
|
||||
|
||||
|
||||
|
||||
@@ -684,3 +685,56 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
## test_query_parameter_collection_format
|
||||
|
||||
> test_query_parameter_collection_format(pipe, ioutil, http, url, context)
|
||||
|
||||
|
||||
|
||||
To test the collection format in query parameters
|
||||
|
||||
### Example
|
||||
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
|
||||
api_instance = Petstore::FakeApi.new
|
||||
pipe = ['pipe_example'] # Array<String> |
|
||||
ioutil = ['ioutil_example'] # Array<String> |
|
||||
http = ['http_example'] # Array<String> |
|
||||
url = ['url_example'] # Array<String> |
|
||||
context = ['context_example'] # Array<String> |
|
||||
|
||||
begin
|
||||
api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pipe** | [**Array<String>**](String.md)| |
|
||||
**ioutil** | [**Array<String>**](String.md)| |
|
||||
**http** | [**Array<String>**](String.md)| |
|
||||
**url** | [**Array<String>**](String.md)| |
|
||||
**context** | [**Array<String>**](String.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
nil (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
@@ -985,5 +985,92 @@ module Petstore
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# To test the collection format in query parameters
|
||||
# @param pipe [Array<String>]
|
||||
# @param ioutil [Array<String>]
|
||||
# @param http [Array<String>]
|
||||
# @param url [Array<String>]
|
||||
# @param context [Array<String>]
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [nil]
|
||||
def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {})
|
||||
test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts)
|
||||
nil
|
||||
end
|
||||
|
||||
# To test the collection format in query parameters
|
||||
# @param pipe [Array<String>]
|
||||
# @param ioutil [Array<String>]
|
||||
# @param http [Array<String>]
|
||||
# @param url [Array<String>]
|
||||
# @param context [Array<String>]
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
||||
def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...'
|
||||
end
|
||||
# verify the required parameter 'pipe' is set
|
||||
if @api_client.config.client_side_validation && pipe.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format"
|
||||
end
|
||||
# verify the required parameter 'ioutil' is set
|
||||
if @api_client.config.client_side_validation && ioutil.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format"
|
||||
end
|
||||
# verify the required parameter 'http' is set
|
||||
if @api_client.config.client_side_validation && http.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format"
|
||||
end
|
||||
# verify the required parameter 'url' is set
|
||||
if @api_client.config.client_side_validation && url.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format"
|
||||
end
|
||||
# verify the required parameter 'context' is set
|
||||
if @api_client.config.client_side_validation && context.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/fake/test-query-paramters'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv)
|
||||
query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv)
|
||||
query_params[:'http'] = @api_client.build_collection_param(http, :space)
|
||||
query_params[:'url'] = @api_client.build_collection_param(url, :csv)
|
||||
query_params[:'context'] = @api_client.build_collection_param(context, :multi)
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:return_type]
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
:form_params => form_params,
|
||||
:body => post_body,
|
||||
:auth_names => auth_names,
|
||||
:return_type => return_type
|
||||
)
|
||||
|
||||
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'faraday'
|
||||
require 'json'
|
||||
require 'logger'
|
||||
require 'tempfile'
|
||||
require 'faraday'
|
||||
|
||||
module Petstore
|
||||
class ApiClient
|
||||
@@ -46,7 +46,15 @@ module Petstore
|
||||
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
||||
# the data deserialized from response body (could be nil), response status code and response headers.
|
||||
def call_api(http_method, path, opts = {})
|
||||
connection = Faraday.new(:url => config.base_url) do |conn|
|
||||
ssl_options = {
|
||||
:ca_file => @config.ssl_ca_file,
|
||||
:verify => @config.ssl_verify,
|
||||
:verify_mode => @config.ssl_verify_mode,
|
||||
:client_cert => @config.ssl_client_cert,
|
||||
:client_key => @config.ssl_client_key
|
||||
}
|
||||
|
||||
connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
|
||||
conn.basic_auth(config.username, config.password)
|
||||
if opts[:header_params]["Content-Type"] == "multipart/form-data"
|
||||
conn.request :multipart
|
||||
@@ -54,6 +62,7 @@ module Petstore
|
||||
end
|
||||
conn.adapter(Faraday.default_adapter)
|
||||
end
|
||||
|
||||
begin
|
||||
response = connection.public_send(http_method.to_sym.downcase) do |req|
|
||||
build_request(http_method, path, req, opts)
|
||||
@@ -106,25 +115,15 @@ module Petstore
|
||||
|
||||
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
||||
|
||||
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
||||
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
||||
|
||||
req_opts = {
|
||||
:method => http_method,
|
||||
:headers => header_params,
|
||||
:params => query_params,
|
||||
:params_encoding => @config.params_encoding,
|
||||
:timeout => @config.timeout,
|
||||
:ssl_verifypeer => @config.verify_ssl,
|
||||
:ssl_verifyhost => _verify_ssl_host,
|
||||
:sslcert => @config.cert_file,
|
||||
:sslkey => @config.key_file,
|
||||
:verbose => @config.debugging
|
||||
}
|
||||
|
||||
# set custom cert, if provided
|
||||
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
||||
|
||||
if [:post, :patch, :put, :delete].include?(http_method)
|
||||
req_body = build_request_body(header_params, form_params, opts[:body])
|
||||
req_opts.update :body => req_body
|
||||
@@ -134,12 +133,44 @@ module Petstore
|
||||
end
|
||||
request.headers = header_params
|
||||
request.body = req_body
|
||||
request.url path
|
||||
request.url url
|
||||
request.params = query_params
|
||||
download_file(request) if opts[:return_type] == 'File'
|
||||
request
|
||||
end
|
||||
|
||||
# Builds the HTTP request body
|
||||
#
|
||||
# @param [Hash] header_params Header parameters
|
||||
# @param [Hash] form_params Query parameters
|
||||
# @param [Object] body HTTP body (JSON/XML)
|
||||
# @return [String] HTTP body data in the form of string
|
||||
def build_request_body(header_params, form_params, body)
|
||||
# http form
|
||||
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
|
||||
data = URI.encode_www_form(form_params)
|
||||
elsif header_params['Content-Type'] == 'multipart/form-data'
|
||||
data = {}
|
||||
form_params.each do |key, value|
|
||||
case value
|
||||
when ::File, ::Tempfile
|
||||
# TODO hardcode to application/octet-stream, need better way to detect content type
|
||||
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
|
||||
when ::Array, nil
|
||||
# let Faraday handle Array and nil parameters
|
||||
data[key] = value
|
||||
else
|
||||
data[key] = value.to_s
|
||||
end
|
||||
end
|
||||
elsif body
|
||||
data = body.is_a?(String) ? body : body.to_json
|
||||
else
|
||||
data = nil
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
# Check if the given MIME is a JSON MIME.
|
||||
# JSON MIME examples:
|
||||
# application/json
|
||||
@@ -277,36 +308,6 @@ module Petstore
|
||||
@config.base_url + path
|
||||
end
|
||||
|
||||
# Builds the HTTP request body
|
||||
#
|
||||
# @param [Hash] header_params Header parameters
|
||||
# @param [Hash] form_params Query parameters
|
||||
# @param [Object] body HTTP body (JSON/XML)
|
||||
# @return [String] HTTP body data in the form of string
|
||||
def build_request_body(header_params, form_params, body)
|
||||
# http form
|
||||
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
||||
header_params['Content-Type'] == 'multipart/form-data'
|
||||
data = {}
|
||||
form_params.each do |key, value|
|
||||
case value
|
||||
when ::File, ::Tempfile
|
||||
data[key] = Faraday::UploadIO.new(value.path, '')
|
||||
when ::Array, nil
|
||||
# let Faraday handle Array and nil parameters
|
||||
data[key] = value
|
||||
else
|
||||
data[key] = value.to_s
|
||||
end
|
||||
end
|
||||
elsif body
|
||||
data = body.is_a?(String) ? body : body.to_json
|
||||
else
|
||||
data = nil
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
# Update hearder and query params based on authentication settings.
|
||||
#
|
||||
# @param [Hash] header_params Header parameters
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
@@ -86,33 +86,28 @@ module Petstore
|
||||
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
||||
#
|
||||
# @return [true, false]
|
||||
attr_accessor :verify_ssl
|
||||
attr_accessor :ssl_verify
|
||||
|
||||
### TLS/SSL setting
|
||||
# Set this to false to skip verifying SSL host name
|
||||
# Default to true.
|
||||
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
||||
#
|
||||
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
||||
#
|
||||
# @return [true, false]
|
||||
attr_accessor :verify_ssl_host
|
||||
attr_accessor :ssl_verify_mode
|
||||
|
||||
### TLS/SSL setting
|
||||
# Set this to customize the certificate file to verify the peer.
|
||||
#
|
||||
# @return [String] the path to the certificate file
|
||||
#
|
||||
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
||||
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
||||
attr_accessor :ssl_ca_cert
|
||||
attr_accessor :ssl_ca_file
|
||||
|
||||
### TLS/SSL setting
|
||||
# Client certificate file (for client certificate)
|
||||
attr_accessor :cert_file
|
||||
attr_accessor :ssl_client_cert
|
||||
|
||||
### TLS/SSL setting
|
||||
# Client private key file (for client certificate)
|
||||
attr_accessor :key_file
|
||||
attr_accessor :ssl_client_key
|
||||
|
||||
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
||||
# Default to nil.
|
||||
@@ -133,11 +128,11 @@ module Petstore
|
||||
@api_key_prefix = {}
|
||||
@timeout = 0
|
||||
@client_side_validation = true
|
||||
@verify_ssl = true
|
||||
@verify_ssl_host = true
|
||||
@params_encoding = nil
|
||||
@cert_file = nil
|
||||
@key_file = nil
|
||||
@ssl_verify = true
|
||||
@ssl_verify_mode = nil
|
||||
@ssl_ca_file = nil
|
||||
@ssl_client_cert = nil
|
||||
@ssl_client_key = nil
|
||||
@debugging = false
|
||||
@inject_format = false
|
||||
@force_ending_format = false
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
||||
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
@@ -31,8 +31,6 @@ Gem::Specification.new do |s|
|
||||
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
||||
|
||||
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
||||
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
||||
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
||||
|
||||
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
||||
s.test_files = `find spec/*`.split("\n")
|
||||
|
||||
@@ -1 +1 @@
|
||||
4.1.0-SNAPSHOT
|
||||
4.1.1-SNAPSHOT
|
||||
12
samples/client/petstore/rust/docs/InlineObject.md
Normal file
12
samples/client/petstore/rust/docs/InlineObject.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# InlineObject
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | Updated name of the pet | [optional]
|
||||
**status** | **String** | Updated status of the pet | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
12
samples/client/petstore/rust/docs/InlineObject1.md
Normal file
12
samples/client/petstore/rust/docs/InlineObject1.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# InlineObject1
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**additional_metadata** | **String** | Additional data to pass to server | [optional]
|
||||
**file** | [***std::path::PathBuf**](std::path::PathBuf.md) | file to upload | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
32
samples/client/petstore/rust/src/models/inline_object.rs
Normal file
32
samples/client/petstore/rust/src/models/inline_object.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct InlineObject {
|
||||
/// Updated name of the pet
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
/// Updated status of the pet
|
||||
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
|
||||
pub status: Option<String>,
|
||||
}
|
||||
|
||||
impl InlineObject {
|
||||
pub fn new() -> InlineObject {
|
||||
InlineObject {
|
||||
name: None,
|
||||
status: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
32
samples/client/petstore/rust/src/models/inline_object_1.rs
Normal file
32
samples/client/petstore/rust/src/models/inline_object_1.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct InlineObject1 {
|
||||
/// Additional data to pass to server
|
||||
#[serde(rename = "additionalMetadata", skip_serializing_if = "Option::is_none")]
|
||||
pub additional_metadata: Option<String>,
|
||||
/// file to upload
|
||||
#[serde(rename = "file", skip_serializing_if = "Option::is_none")]
|
||||
pub file: Option<std::path::PathBuf>,
|
||||
}
|
||||
|
||||
impl InlineObject1 {
|
||||
pub fn new() -> InlineObject1 {
|
||||
InlineObject1 {
|
||||
additional_metadata: None,
|
||||
file: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ setup(
|
||||
url="",
|
||||
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
|
||||
install_requires=REQUIRES,
|
||||
packages=find_packages(),
|
||||
packages=find_packages(exclude=["test", "tests"]),
|
||||
include_package_data=True,
|
||||
long_description="""\
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
@@ -103,7 +103,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
@@ -290,7 +290,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
@@ -414,7 +414,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
@@ -480,7 +480,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
@@ -552,7 +552,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
|
||||
@@ -43,7 +43,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
@@ -167,7 +167,7 @@ module Petstore
|
||||
end
|
||||
|
||||
# resource path
|
||||
local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
|
||||
@@ -225,7 +225,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
@@ -283,7 +283,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
@@ -471,7 +471,7 @@ module Petstore
|
||||
fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/'))
|
||||
local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
|
||||
Reference in New Issue
Block a user