[JAVA] fix toUrlQueryString for BigDecimal (#15764)

* add MyImportTest.java

* fix original issue

* fix same issue for native library

* remove MyImportTest

* add test configs

* generate samples (again?)

* generate samples again

* generate samples again, undo pom.xml mistake [amended to retrigger circliCi]
This commit is contained in:
martin-mfg 2023-06-08 03:34:06 +02:00 committed by GitHub
parent fbe768bb9c
commit b7f2b723aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
176 changed files with 7934 additions and 8 deletions

View File

@ -478,7 +478,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isArray}}
{{^isArray}}
{{#isMap}}
{{#items.isPrimitiveType}}
{{^items.isModel}}
if ({{getter}}() != null) {
for (String _key : {{getter}}().keySet()) {
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
@ -486,8 +486,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
}
{{/items.isPrimitiveType}}
{{^items.isPrimitiveType}}
{{/items.isModel}}
{{#items.isModel}}
if ({{getter}}() != null) {
for (String _key : {{getter}}().keySet()) {
if ({{getter}}().get(_key) != null) {
@ -496,7 +496,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
}
}
{{/items.isPrimitiveType}}
{{/items.isModel}}
{{/isMap}}
{{^isMap}}
{{#isPrimitiveType}}

View File

@ -494,7 +494,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isArray}}
{{^isArray}}
{{#isMap}}
{{#items.isPrimitiveType}}
{{^items.isModel}}
if ({{getter}}() != null) {
for (String _key : {{getter}}().keySet()) {
try {
@ -507,8 +507,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
}
}
{{/items.isPrimitiveType}}
{{^items.isPrimitiveType}}
{{/items.isModel}}
{{#items.isModel}}
if ({{getter}}() != null) {
for (String _key : {{getter}}().keySet()) {
if ({{getter}}().get(_key) != null) {
@ -517,7 +517,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
}
}
{{/items.isPrimitiveType}}
{{/items.isModel}}
{{/isMap}}
{{^isMap}}
{{#isPrimitiveType}}

View File

@ -899,6 +899,26 @@ paths:
schema:
$ref: '#/components/schemas/OuterComposite'
description: Input composite as post body
/fake/BigDecimalMap:
get:
tags:
- fake
description: for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
operationId: fakeBigDecimalMap
responses:
'200':
description: successful operation
content:
'*/*':
schema:
type: object
properties:
someId:
type: number
someMap:
type: object
additionalProperties:
type: number
/fake/jsonFormData:
get:
tags:

View File

@ -950,6 +950,26 @@ paths:
schema:
$ref: '#/components/schemas/OuterComposite'
description: Input composite as post body
/fake/BigDecimalMap:
get:
tags:
- fake
description: for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
operationId: fakeBigDecimalMap
responses:
'200':
description: successful operation
content:
'*/*':
schema:
type: object
properties:
someId:
type: number
someMap:
type: object
additionalProperties:
type: number
/fake/jsonFormData:
get:
tags:

View File

@ -33,6 +33,7 @@ lib/openapi_petstore/model/dog_all_of.ex
lib/openapi_petstore/model/enum_arrays.ex
lib/openapi_petstore/model/enum_class.ex
lib/openapi_petstore/model/enum_test.ex
lib/openapi_petstore/model/fake_big_decimal_map_200_response.ex
lib/openapi_petstore/model/file.ex
lib/openapi_petstore/model/file_schema_test_class.ex
lib/openapi_petstore/model/foo.ex

View File

@ -9,6 +9,34 @@ defmodule OpenapiPetstore.Api.Fake do
alias OpenapiPetstore.Connection
import OpenapiPetstore.RequestBuilder
@doc """
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Parameters
- `connection` (OpenapiPetstore.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenapiPetstore.Model.FakeBigDecimalMap200Response.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec fake_big_decimal_map(Tesla.Env.client, keyword()) :: {:ok, OpenapiPetstore.Model.FakeBigDecimalMap200Response.t} | {:error, Tesla.Env.t}
def fake_big_decimal_map(connection, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/fake/BigDecimalMap")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %OpenapiPetstore.Model.FakeBigDecimalMap200Response{}}
])
end
@doc """
Health check endpoint

View File

@ -0,0 +1,26 @@
# NOTE: This file is auto generated by OpenAPI Generator 7.0.0-SNAPSHOT (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule OpenapiPetstore.Model.FakeBigDecimalMap200Response do
@moduledoc """
"""
@derive [Poison.Encoder]
defstruct [
:someId,
:someMap
]
@type t :: %__MODULE__{
:someId => float() | nil,
:someMap => %{optional(String.t) => float()} | nil
}
end
defimpl Poison.Decoder, for: OpenapiPetstore.Model.FakeBigDecimalMap200Response do
def decode(value, _options) do
value
end
end

View File

@ -20,6 +20,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -84,6 +85,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -24,6 +25,38 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> FakeBigDecimalMap200Response fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> HealthCheckResult fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map<String, BigDecimal>** | | [optional] |

View File

@ -28,6 +28,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -48,6 +49,11 @@ import org.openapitools.client.model.User;
@Path("/fake")
public interface FakeApi {
@GET
@Path("/BigDecimalMap")
@Produces({ "*/*" })
FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException, ProcessingException;
/**
* Health check endpoint
*/

View File

@ -0,0 +1,104 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
public class FakeBigDecimalMap200Response {
private BigDecimal someId;
private Map<String, BigDecimal> someMap = null;
/**
* Get someId
* @return someId
**/
public BigDecimal getSomeId() {
return someId;
}
/**
* Set someId
**/
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someMap
* @return someMap
**/
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
/**
* Set someMap
**/
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
this.someMap.put(key, someMapItem);
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,57 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -20,6 +20,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -93,6 +94,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -24,6 +25,68 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> FakeBigDecimalMap200Response fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> HealthCheckResult fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map&lt;String, BigDecimal&gt;** | | [optional] |

View File

@ -16,6 +16,7 @@ import org.openapitools.client.ApiResponse;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -35,6 +36,8 @@ import org.openapitools.client.model.User;
*/
public interface FakeApi {
ApiResponse<FakeBigDecimalMap200Response> fakeBigDecimalMap();
/**
* Health check endpoint
* @return {@code ApiResponse<HealthCheckResult>}

View File

@ -32,6 +32,7 @@ import org.openapitools.client.ApiClient;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -57,6 +58,7 @@ public class FakeApiImpl implements FakeApi {
private final ApiClient apiClient;
protected static final GenericType<FakeBigDecimalMap200Response> RESPONSE_TYPE_fakeBigDecimalMap = ResponseType.create(FakeBigDecimalMap200Response.class);
protected static final GenericType<HealthCheckResult> RESPONSE_TYPE_fakeHealthGet = ResponseType.create(HealthCheckResult.class);
protected static final GenericType<Void> RESPONSE_TYPE_fakeHttpSignatureTest = ResponseType.create(Void.class);
protected static final GenericType<Boolean> RESPONSE_TYPE_fakeOuterBooleanSerialize = ResponseType.create(Boolean.class);
@ -87,6 +89,40 @@ public class FakeApiImpl implements FakeApi {
this.apiClient = apiClient;
}
@Override
public ApiResponse<FakeBigDecimalMap200Response> fakeBigDecimalMap() {
WebClientRequestBuilder webClientRequestBuilder = fakeBigDecimalMapRequestBuilder();
return fakeBigDecimalMapSubmit(webClientRequestBuilder);
}
/**
* Creates a {@code WebClientRequestBuilder} for the fakeBigDecimalMap operation.
* Optional customization point for subclasses.
*
* @return WebClientRequestBuilder for fakeBigDecimalMap
*/
protected WebClientRequestBuilder fakeBigDecimalMapRequestBuilder() {
WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient()
.method("GET");
webClientRequestBuilder.path("/fake/BigDecimalMap");
webClientRequestBuilder.accept(MediaType.APPLICATION_JSON);
return webClientRequestBuilder;
}
/**
* Initiates the request for the fakeBigDecimalMap operation.
* Optional customization point for subclasses.
*
* @param webClientRequestBuilder the request builder to use for submitting the request
* @return {@code ApiResponse<FakeBigDecimalMap200Response>} for the submitted request
*/
protected ApiResponse<FakeBigDecimalMap200Response> fakeBigDecimalMapSubmit(WebClientRequestBuilder webClientRequestBuilder) {
Single<WebClientResponse> webClientResponse = webClientRequestBuilder.submit();
return ApiResponse.create(RESPONSE_TYPE_fakeBigDecimalMap, webClientResponse);
}
@Override
public ApiResponse<HealthCheckResult> fakeHealthGet() {
WebClientRequestBuilder webClientRequestBuilder = fakeHealthGetRequestBuilder();

View File

@ -0,0 +1,104 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
public class FakeBigDecimalMap200Response {
private BigDecimal someId;
private Map<String, BigDecimal> someMap = null;
/**
* Get someId
* @return someId
**/
public BigDecimal getSomeId() {
return someId;
}
/**
* Set someId
**/
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someMap
* @return someMap
**/
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
/**
* Set someMap
**/
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
this.someMap.put(key, someMapItem);
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,57 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -26,6 +26,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -109,6 +110,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -108,6 +108,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
@ -169,6 +170,7 @@ Class | Method | HTTP request | Description
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)

View File

@ -978,6 +978,21 @@ paths:
- fake
x-content-type: application/json
x-accepts: '*/*'
/fake/BigDecimalMap:
get:
description: "for Java apache and Java native, test toUrlQueryString for maps\
\ with BegDecimal keys"
operationId: fakeBigDecimalMap
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/fakeBigDecimalMap_200_response'
description: successful operation
tags:
- fake
x-accepts: '*/*'
/fake/jsonFormData:
get:
description: ""
@ -2107,6 +2122,19 @@ components:
- number
- pattern_without_delimiter
type: object
fakeBigDecimalMap_200_response:
example:
someId: 0.8008281904610115
someMap:
key: 6.027456183070403
properties:
someId:
type: number
someMap:
additionalProperties:
type: number
type: object
type: object
testJsonFormData_request:
properties:
param:

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -24,6 +25,68 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> FakeBigDecimalMap200Response fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> HealthCheckResult fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map&lt;String, BigDecimal&gt;** | | [optional] |

View File

@ -23,6 +23,7 @@ import org.openapitools.client.Pair;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -63,6 +64,73 @@ public class FakeApi {
this.apiClient = apiClient;
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @return FakeBigDecimalMap200Response
* @throws ApiException if fails to make API call
*/
public FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException {
return this.fakeBigDecimalMap(Collections.emptyMap());
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @param additionalHeaders additionalHeaders for this call
* @return FakeBigDecimalMap200Response
* @throws ApiException if fails to make API call
*/
public FakeBigDecimalMap200Response fakeBigDecimalMap(Map<String, String> additionalHeaders) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/fake/BigDecimalMap";
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarHeaderParams.putAll(additionalHeaders);
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
TypeReference<FakeBigDecimalMap200Response> localVarReturnType = new TypeReference<FakeBigDecimalMap200Response>() {};
return apiClient.invokeAPI(
localVarPath,
"GET",
localVarQueryParams,
localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(),
localVarPostBody,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType
);
}
/**
* Health check endpoint
*

View File

@ -0,0 +1,209 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;
/**
* FakeBigDecimalMap200Response
*/
@JsonPropertyOrder({
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID,
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP
})
@JsonTypeName("fakeBigDecimalMap_200_response")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FakeBigDecimalMap200Response {
public static final String JSON_PROPERTY_SOME_ID = "someId";
private BigDecimal someId;
public static final String JSON_PROPERTY_SOME_MAP = "someMap";
private Map<String, BigDecimal> someMap = new HashMap<>();
public FakeBigDecimalMap200Response() {
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someId
* @return someId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getSomeId() {
return someId;
}
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
/**
* Get someMap
* @return someMap
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
}
@Override
public int hashCode() {
return Objects.hash(someId, someMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `someId` to the URL query string
if (getSomeId() != null) {
try {
joiner.add(String.format("%ssomeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeId()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `someMap` to the URL query string
if (getSomeMap() != null) {
for (String _key : getSomeMap().keySet()) {
try {
joiner.add(String.format("%ssomeMap%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
getSomeMap().get(_key), URLEncoder.encode(String.valueOf(getSomeMap().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
}
return joiner.toString();
}
}

View File

@ -0,0 +1,58 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -57,6 +57,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/File.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java

View File

@ -978,6 +978,21 @@ paths:
- fake
x-content-type: application/json
x-accepts: '*/*'
/fake/BigDecimalMap:
get:
description: "for Java apache and Java native, test toUrlQueryString for maps\
\ with BegDecimal keys"
operationId: fakeBigDecimalMap
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/fakeBigDecimalMap_200_response'
description: successful operation
tags:
- fake
x-accepts: '*/*'
/fake/jsonFormData:
get:
description: ""
@ -2107,6 +2122,19 @@ components:
- number
- pattern_without_delimiter
type: object
fakeBigDecimalMap_200_response:
example:
someId: 0.8008281904610115
someMap:
key: 6.027456183070403
properties:
someId:
type: number
someMap:
additionalProperties:
type: number
type: object
type: object
testJsonFormData_request:
properties:
param:

View File

@ -7,6 +7,7 @@ import org.openapitools.client.model.ApiResponse;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -27,6 +28,31 @@ import feign.*;
public interface FakeApi extends ApiClient.Api {
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @return FakeBigDecimalMap200Response
*/
@RequestLine("GET /fake/BigDecimalMap")
@Headers({
"Accept: */*",
})
FakeBigDecimalMap200Response fakeBigDecimalMap();
/**
*
* Similar to <code>fakeBigDecimalMap</code> but it also returns the http response headers .
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("GET /fake/BigDecimalMap")
@Headers({
"Accept: */*",
})
ApiResponse<FakeBigDecimalMap200Response> fakeBigDecimalMapWithHttpInfo();
/**
* Health check endpoint
*

View File

@ -0,0 +1,147 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* FakeBigDecimalMap200Response
*/
@JsonPropertyOrder({
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID,
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP
})
@JsonTypeName("fakeBigDecimalMap_200_response")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FakeBigDecimalMap200Response {
public static final String JSON_PROPERTY_SOME_ID = "someId";
private BigDecimal someId;
public static final String JSON_PROPERTY_SOME_MAP = "someMap";
private Map<String, BigDecimal> someMap = new HashMap<>();
public FakeBigDecimalMap200Response() {
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someId
* @return someId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getSomeId() {
return someId;
}
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
/**
* Get someMap
* @return someMap
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
}
@Override
public int hashCode() {
return Objects.hash(someId, someMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,56 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
void someMapTest() {
// TODO: test someMap
}
}

View File

@ -36,6 +36,7 @@ docs/EnumClass.md
docs/EnumTest.md
docs/EquilateralTriangle.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -142,6 +143,7 @@ src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/EquilateralTriangle.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -110,6 +110,8 @@ Class | Method | HTTP request | Description
*AnotherFakeApi* | [**call123testSpecialTagsWithHttpInfo**](docs/AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
*DefaultApi* | [**fooGetWithHttpInfo**](docs/DefaultApi.md#fooGetWithHttpInfo) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeBigDecimalMapWithHttpInfo**](docs/FakeApi.md#fakeBigDecimalMapWithHttpInfo) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHealthGetWithHttpInfo**](docs/FakeApi.md#fakeHealthGetWithHttpInfo) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
@ -216,6 +218,7 @@ Class | Method | HTTP request | Description
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- [EquilateralTriangle](docs/EquilateralTriangle.md)
- [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)

View File

@ -920,6 +920,21 @@ paths:
- fake
x-content-type: application/json
x-accepts: '*/*'
/fake/BigDecimalMap:
get:
description: "for Java apache and Java native, test toUrlQueryString for maps\
\ with BegDecimal keys"
operationId: fakeBigDecimalMap
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/fakeBigDecimalMap_200_response'
description: successful operation
tags:
- fake
x-accepts: '*/*'
/fake/jsonFormData:
get:
description: ""
@ -2255,6 +2270,19 @@ components:
- number
- pattern_without_delimiter
type: object
fakeBigDecimalMap_200_response:
example:
someId: 0.8008281904610115
someMap:
key: 6.027456183070403
properties:
someId:
type: number
someMap:
additionalProperties:
type: number
type: object
type: object
testJsonFormData_request:
properties:
param:

View File

@ -4,6 +4,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeBigDecimalMapWithHttpInfo**](FakeApi.md#fakeBigDecimalMapWithHttpInfo) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHealthGetWithHttpInfo**](FakeApi.md#fakeHealthGetWithHttpInfo) | **GET** /fake/health | Health check endpoint |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -37,6 +39,141 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> CompletableFuture<FakeBigDecimalMap200Response> fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
import java.util.concurrent.CompletableFuture;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
CompletableFuture<FakeBigDecimalMap200Response> result = apiInstance.fakeBigDecimalMap();
System.out.println(result.get());
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
CompletableFuture<[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)>
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeBigDecimalMapWithHttpInfo
> CompletableFuture<ApiResponse<FakeBigDecimalMap200Response>> fakeBigDecimalMap fakeBigDecimalMapWithHttpInfo()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
import java.util.concurrent.CompletableFuture;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
CompletableFuture<ApiResponse<FakeBigDecimalMap200Response>> response = apiInstance.fakeBigDecimalMapWithHttpInfo();
System.out.println("Status code: " + response.get().getStatusCode());
System.out.println("Response headers: " + response.get().getHeaders());
System.out.println("Response body: " + response.get().getData());
} catch (InterruptedException | ExecutionException e) {
ApiException apiException = (ApiException)e.getCause();
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + apiException.getCode());
System.err.println("Response headers: " + apiException.getResponseHeaders());
System.err.println("Reason: " + apiException.getResponseBody());
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
CompletableFuture<ApiResponse<[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)>>
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> CompletableFuture<HealthCheckResult> fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map&lt;String, BigDecimal&gt;** | | [optional] |

View File

@ -19,6 +19,7 @@ import org.openapitools.client.Pair;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -97,6 +98,92 @@ public class FakeApi {
return operationId + " call failed with: " + statusCode + " - " + body;
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @return CompletableFuture&lt;FakeBigDecimalMap200Response&gt;
* @throws ApiException if fails to make API call
*/
public CompletableFuture<FakeBigDecimalMap200Response> fakeBigDecimalMap() throws ApiException {
try {
HttpRequest.Builder localVarRequestBuilder = fakeBigDecimalMapRequestBuilder();
return memberVarHttpClient.sendAsync(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
if (localVarResponse.statusCode()/ 100 != 2) {
return CompletableFuture.failedFuture(getApiException("fakeBigDecimalMap", localVarResponse));
}
try {
String responseBody = localVarResponse.body();
return CompletableFuture.completedFuture(
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<FakeBigDecimalMap200Response>() {})
);
} catch (IOException e) {
return CompletableFuture.failedFuture(new ApiException(e));
}
});
}
catch (ApiException e) {
return CompletableFuture.failedFuture(e);
}
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @return CompletableFuture&lt;ApiResponse&lt;FakeBigDecimalMap200Response&gt;&gt;
* @throws ApiException if fails to make API call
*/
public CompletableFuture<ApiResponse<FakeBigDecimalMap200Response>> fakeBigDecimalMapWithHttpInfo() throws ApiException {
try {
HttpRequest.Builder localVarRequestBuilder = fakeBigDecimalMapRequestBuilder();
return memberVarHttpClient.sendAsync(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
if (memberVarAsyncResponseInterceptor != null) {
memberVarAsyncResponseInterceptor.accept(localVarResponse);
}
if (localVarResponse.statusCode()/ 100 != 2) {
return CompletableFuture.failedFuture(getApiException("fakeBigDecimalMap", localVarResponse));
}
try {
String responseBody = localVarResponse.body();
return CompletableFuture.completedFuture(
new ApiResponse<FakeBigDecimalMap200Response>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<FakeBigDecimalMap200Response>() {}))
);
} catch (IOException e) {
return CompletableFuture.failedFuture(new ApiException(e));
}
}
);
}
catch (ApiException e) {
return CompletableFuture.failedFuture(e);
}
}
private HttpRequest.Builder fakeBigDecimalMapRequestBuilder() throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/fake/BigDecimalMap";
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "*/*");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Health check endpoint
*

View File

@ -0,0 +1,201 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* FakeBigDecimalMap200Response
*/
@JsonPropertyOrder({
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID,
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FakeBigDecimalMap200Response {
public static final String JSON_PROPERTY_SOME_ID = "someId";
private BigDecimal someId;
public static final String JSON_PROPERTY_SOME_MAP = "someMap";
private Map<String, BigDecimal> someMap = new HashMap<>();
public FakeBigDecimalMap200Response() {
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someId
* @return someId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getSomeId() {
return someId;
}
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
/**
* Get someMap
* @return someMap
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
/**
* Return true if this fakeBigDecimalMap_200_response object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
}
@Override
public int hashCode() {
return Objects.hash(someId, someMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `someId` to the URL query string
if (getSomeId() != null) {
joiner.add(String.format("%ssomeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `someMap` to the URL query string
if (getSomeMap() != null) {
for (String _key : getSomeMap().keySet()) {
joiner.add(String.format("%ssomeMap%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
getSomeMap().get(_key), URLEncoder.encode(String.valueOf(getSomeMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
}
return joiner.toString();
}
}

View File

@ -0,0 +1,58 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -36,6 +36,7 @@ docs/EnumClass.md
docs/EnumTest.md
docs/EquilateralTriangle.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -142,6 +143,7 @@ src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/EquilateralTriangle.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -109,6 +109,8 @@ Class | Method | HTTP request | Description
*AnotherFakeApi* | [**call123testSpecialTagsWithHttpInfo**](docs/AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
*DefaultApi* | [**fooGetWithHttpInfo**](docs/DefaultApi.md#fooGetWithHttpInfo) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeBigDecimalMapWithHttpInfo**](docs/FakeApi.md#fakeBigDecimalMapWithHttpInfo) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHealthGetWithHttpInfo**](docs/FakeApi.md#fakeHealthGetWithHttpInfo) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
@ -215,6 +217,7 @@ Class | Method | HTTP request | Description
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- [EquilateralTriangle](docs/EquilateralTriangle.md)
- [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)

View File

@ -920,6 +920,21 @@ paths:
- fake
x-content-type: application/json
x-accepts: '*/*'
/fake/BigDecimalMap:
get:
description: "for Java apache and Java native, test toUrlQueryString for maps\
\ with BegDecimal keys"
operationId: fakeBigDecimalMap
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/fakeBigDecimalMap_200_response'
description: successful operation
tags:
- fake
x-accepts: '*/*'
/fake/jsonFormData:
get:
description: ""
@ -2255,6 +2270,19 @@ components:
- number
- pattern_without_delimiter
type: object
fakeBigDecimalMap_200_response:
example:
someId: 0.8008281904610115
someMap:
key: 6.027456183070403
properties:
someId:
type: number
someMap:
additionalProperties:
type: number
type: object
type: object
testJsonFormData_request:
properties:
param:

View File

@ -4,6 +4,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeBigDecimalMapWithHttpInfo**](FakeApi.md#fakeBigDecimalMapWithHttpInfo) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHealthGetWithHttpInfo**](FakeApi.md#fakeHealthGetWithHttpInfo) | **GET** /fake/health | Health check endpoint |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -37,6 +39,132 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> FakeBigDecimalMap200Response fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeBigDecimalMapWithHttpInfo
> ApiResponse<FakeBigDecimalMap200Response> fakeBigDecimalMap fakeBigDecimalMapWithHttpInfo()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
ApiResponse<FakeBigDecimalMap200Response> response = apiInstance.fakeBigDecimalMapWithHttpInfo();
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
ApiResponse<[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)>
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> HealthCheckResult fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map&lt;String, BigDecimal&gt;** | | [optional] |

View File

@ -19,6 +19,7 @@ import org.openapitools.client.Pair;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -96,6 +97,71 @@ public class FakeApi {
return operationId + " call failed with: " + statusCode + " - " + body;
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @return FakeBigDecimalMap200Response
* @throws ApiException if fails to make API call
*/
public FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException {
ApiResponse<FakeBigDecimalMap200Response> localVarResponse = fakeBigDecimalMapWithHttpInfo();
return localVarResponse.getData();
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* @return ApiResponse&lt;FakeBigDecimalMap200Response&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<FakeBigDecimalMap200Response> fakeBigDecimalMapWithHttpInfo() throws ApiException {
HttpRequest.Builder localVarRequestBuilder = fakeBigDecimalMapRequestBuilder();
try {
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("fakeBigDecimalMap", localVarResponse);
}
return new ApiResponse<FakeBigDecimalMap200Response>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<FakeBigDecimalMap200Response>() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
private HttpRequest.Builder fakeBigDecimalMapRequestBuilder() throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/fake/BigDecimalMap";
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "*/*");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Health check endpoint
*

View File

@ -0,0 +1,201 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* FakeBigDecimalMap200Response
*/
@JsonPropertyOrder({
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID,
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FakeBigDecimalMap200Response {
public static final String JSON_PROPERTY_SOME_ID = "someId";
private BigDecimal someId;
public static final String JSON_PROPERTY_SOME_MAP = "someMap";
private Map<String, BigDecimal> someMap = new HashMap<>();
public FakeBigDecimalMap200Response() {
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someId
* @return someId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getSomeId() {
return someId;
}
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
/**
* Get someMap
* @return someMap
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
/**
* Return true if this fakeBigDecimalMap_200_response object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
}
@Override
public int hashCode() {
return Objects.hash(someId, someMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `someId` to the URL query string
if (getSomeId() != null) {
joiner.add(String.format("%ssomeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `someMap` to the URL query string
if (getSomeMap() != null) {
for (String _key : getSomeMap().keySet()) {
joiner.add(String.format("%ssomeMap%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
getSomeMap().get(_key), URLEncoder.encode(String.valueOf(getSomeMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
}
return joiner.toString();
}
}

View File

@ -0,0 +1,58 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -26,6 +26,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -106,6 +107,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -115,6 +115,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
@ -176,6 +177,7 @@ Class | Method | HTTP request | Description
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)

View File

@ -978,6 +978,21 @@ paths:
- fake
x-content-type: application/json
x-accepts: '*/*'
/fake/BigDecimalMap:
get:
description: "for Java apache and Java native, test toUrlQueryString for maps\
\ with BegDecimal keys"
operationId: fakeBigDecimalMap
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/fakeBigDecimalMap_200_response'
description: successful operation
tags:
- fake
x-accepts: '*/*'
/fake/jsonFormData:
get:
description: ""
@ -2107,6 +2122,19 @@ components:
- number
- pattern_without_delimiter
type: object
fakeBigDecimalMap_200_response:
example:
someId: 0.8008281904610115
someMap:
key: 6.027456183070403
properties:
someId:
type: number
someMap:
additionalProperties:
type: number
type: object
type: object
testJsonFormData_request:
properties:
param:

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -24,6 +25,68 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> FakeBigDecimalMap200Response fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> HealthCheckResult fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map&lt;String, BigDecimal&gt;** | | [optional] |

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -57,6 +58,70 @@ public class FakeApi {
this.apiClient = apiClient;
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return FakeBigDecimalMap200Response
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec fakeBigDecimalMapRequestCreation() throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return apiClient.invokeAPI("/fake/BigDecimalMap", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return FakeBigDecimalMap200Response
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<FakeBigDecimalMap200Response> fakeBigDecimalMap() throws WebClientResponseException {
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return fakeBigDecimalMapRequestCreation().bodyToMono(localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return ResponseEntity&lt;FakeBigDecimalMap200Response&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ResponseEntity<FakeBigDecimalMap200Response>> fakeBigDecimalMapWithHttpInfo() throws WebClientResponseException {
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return fakeBigDecimalMapRequestCreation().toEntity(localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec fakeBigDecimalMapWithResponseSpec() throws WebClientResponseException {
return fakeBigDecimalMapRequestCreation();
}
/**
* Health check endpoint
*

View File

@ -0,0 +1,147 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* FakeBigDecimalMap200Response
*/
@JsonPropertyOrder({
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID,
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP
})
@JsonTypeName("fakeBigDecimalMap_200_response")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FakeBigDecimalMap200Response {
public static final String JSON_PROPERTY_SOME_ID = "someId";
private BigDecimal someId;
public static final String JSON_PROPERTY_SOME_MAP = "someMap";
private Map<String, BigDecimal> someMap = new HashMap<>();
public FakeBigDecimalMap200Response() {
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someId
* @return someId
**/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getSomeId() {
return someId;
}
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
/**
* Get someMap
* @return someMap
**/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
}
@Override
public int hashCode() {
return Objects.hash(someId, someMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,58 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -26,6 +26,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -106,6 +107,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -115,6 +115,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
@ -176,6 +177,7 @@ Class | Method | HTTP request | Description
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)

View File

@ -978,6 +978,21 @@ paths:
- fake
x-content-type: application/json
x-accepts: '*/*'
/fake/BigDecimalMap:
get:
description: "for Java apache and Java native, test toUrlQueryString for maps\
\ with BegDecimal keys"
operationId: fakeBigDecimalMap
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/fakeBigDecimalMap_200_response'
description: successful operation
tags:
- fake
x-accepts: '*/*'
/fake/jsonFormData:
get:
description: ""
@ -2107,6 +2122,19 @@ components:
- number
- pattern_without_delimiter
type: object
fakeBigDecimalMap_200_response:
example:
someId: 0.8008281904610115
someMap:
key: 6.027456183070403
properties:
someId:
type: number
someMap:
additionalProperties:
type: number
type: object
type: object
testJsonFormData_request:
properties:
param:

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -24,6 +25,68 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> FakeBigDecimalMap200Response fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> HealthCheckResult fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map&lt;String, BigDecimal&gt;** | | [optional] |

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -57,6 +58,70 @@ public class FakeApi {
this.apiClient = apiClient;
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return FakeBigDecimalMap200Response
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec fakeBigDecimalMapRequestCreation() throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return apiClient.invokeAPI("/fake/BigDecimalMap", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return FakeBigDecimalMap200Response
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<FakeBigDecimalMap200Response> fakeBigDecimalMap() throws WebClientResponseException {
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return fakeBigDecimalMapRequestCreation().bodyToMono(localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return ResponseEntity&lt;FakeBigDecimalMap200Response&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ResponseEntity<FakeBigDecimalMap200Response>> fakeBigDecimalMapWithHttpInfo() throws WebClientResponseException {
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return fakeBigDecimalMapRequestCreation().toEntity(localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec fakeBigDecimalMapWithResponseSpec() throws WebClientResponseException {
return fakeBigDecimalMapRequestCreation();
}
/**
* Health check endpoint
*

View File

@ -0,0 +1,150 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* FakeBigDecimalMap200Response
*/
@JsonPropertyOrder({
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID,
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP
})
@JsonTypeName("fakeBigDecimalMap_200_response")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FakeBigDecimalMap200Response {
public static final String JSON_PROPERTY_SOME_ID = "someId";
private BigDecimal someId;
public static final String JSON_PROPERTY_SOME_MAP = "someMap";
private Map<String, BigDecimal> someMap;
public FakeBigDecimalMap200Response() {
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someId
* @return someId
**/
@javax.annotation.Nullable
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "")
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getSomeId() {
return someId;
}
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
/**
* Get someMap
* @return someMap
**/
@javax.annotation.Nullable
@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "")
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
}
@Override
public int hashCode() {
return Objects.hash(someId, someMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,59 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -26,6 +26,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/FileSchemaTestClass.md
docs/Foo.md
@ -106,6 +107,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
src/main/java/org/openapitools/client/model/EnumArrays.java
src/main/java/org/openapitools/client/model/EnumClass.java
src/main/java/org/openapitools/client/model/EnumTest.java
src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
src/main/java/org/openapitools/client/model/Foo.java
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java

View File

@ -115,6 +115,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
@ -176,6 +177,7 @@ Class | Method | HTTP request | Description
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
- [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Foo](docs/Foo.md)
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)

View File

@ -978,6 +978,21 @@ paths:
- fake
x-content-type: application/json
x-accepts: '*/*'
/fake/BigDecimalMap:
get:
description: "for Java apache and Java native, test toUrlQueryString for maps\
\ with BegDecimal keys"
operationId: fakeBigDecimalMap
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/fakeBigDecimalMap_200_response'
description: successful operation
tags:
- fake
x-accepts: '*/*'
/fake/jsonFormData:
get:
description: ""
@ -2107,6 +2122,19 @@ components:
- number
- pattern_without_delimiter
type: object
fakeBigDecimalMap_200_response:
example:
someId: 0.8008281904610115
someMap:
key: 6.027456183070403
properties:
someId:
type: number
someMap:
additionalProperties:
type: number
type: object
type: object
testJsonFormData_request:
properties:
param:

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -24,6 +25,68 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
## fakeBigDecimalMap
> FakeBigDecimalMap200Response fakeBigDecimalMap()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FakeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient);
try {
FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#fakeBigDecimalMap");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
## fakeHealthGet
> HealthCheckResult fakeHealthGet()

View File

@ -0,0 +1,14 @@
# FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**someId** | **BigDecimal** | | [optional] |
|**someMap** | **Map&lt;String, BigDecimal&gt;** | | [optional] |

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import org.openapitools.client.model.EnumClass;
import org.openapitools.client.model.FakeBigDecimalMap200Response;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import org.openapitools.client.model.HealthCheckResult;
@ -57,6 +58,70 @@ public class FakeApi {
this.apiClient = apiClient;
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return FakeBigDecimalMap200Response
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec fakeBigDecimalMapRequestCreation() throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return apiClient.invokeAPI("/fake/BigDecimalMap", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return FakeBigDecimalMap200Response
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<FakeBigDecimalMap200Response> fakeBigDecimalMap() throws WebClientResponseException {
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return fakeBigDecimalMapRequestCreation().bodyToMono(localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return ResponseEntity&lt;FakeBigDecimalMap200Response&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ResponseEntity<FakeBigDecimalMap200Response>> fakeBigDecimalMapWithHttpInfo() throws WebClientResponseException {
ParameterizedTypeReference<FakeBigDecimalMap200Response> localVarReturnType = new ParameterizedTypeReference<FakeBigDecimalMap200Response>() {};
return fakeBigDecimalMapRequestCreation().toEntity(localVarReturnType);
}
/**
*
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
* <p><b>200</b> - successful operation
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec fakeBigDecimalMapWithResponseSpec() throws WebClientResponseException {
return fakeBigDecimalMapRequestCreation();
}
/**
* Health check endpoint
*

View File

@ -0,0 +1,147 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* FakeBigDecimalMap200Response
*/
@JsonPropertyOrder({
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID,
FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP
})
@JsonTypeName("fakeBigDecimalMap_200_response")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FakeBigDecimalMap200Response {
public static final String JSON_PROPERTY_SOME_ID = "someId";
private BigDecimal someId;
public static final String JSON_PROPERTY_SOME_MAP = "someMap";
private Map<String, BigDecimal> someMap;
public FakeBigDecimalMap200Response() {
}
public FakeBigDecimalMap200Response someId(BigDecimal someId) {
this.someId = someId;
return this;
}
/**
* Get someId
* @return someId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getSomeId() {
return someId;
}
@JsonProperty(JSON_PROPERTY_SOME_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeId(BigDecimal someId) {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
return this;
}
public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
/**
* Get someMap
* @return someMap
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getSomeMap() {
return someMap;
}
@JsonProperty(JSON_PROPERTY_SOME_MAP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSomeMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
}
@Override
public int hashCode() {
return Objects.hash(someId, someMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FakeBigDecimalMap200Response {\n");
sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,58 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for FakeBigDecimalMap200Response
*/
public class FakeBigDecimalMap200ResponseTest {
private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response();
/**
* Model tests for FakeBigDecimalMap200Response
*/
@Test
public void testFakeBigDecimalMap200Response() {
// TODO: test FakeBigDecimalMap200Response
}
/**
* Test the property 'someId'
*/
@Test
public void someIdTest() {
// TODO: test someId
}
/**
* Test the property 'someMap'
*/
@Test
public void someMapTest() {
// TODO: test someMap
}
}

View File

@ -547,6 +547,19 @@ export default function() {
}
});
group("/fake/BigDecimalMap", () => {
// Request No. 1: fakeBigDecimalMap
{
let url = BASE_URL + `/fake/BigDecimalMap`;
let request = http.get(url);
check(request, {
"successful operation": (r) => r.status === 200
});
}
});
group("/fake/health", () => {
// Request No. 1:

View File

@ -24,6 +24,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
@ -84,6 +85,7 @@ lib/WWW/OpenAPIClient/Object/DogAllOf.pm
lib/WWW/OpenAPIClient/Object/EnumArrays.pm
lib/WWW/OpenAPIClient/Object/EnumClass.pm
lib/WWW/OpenAPIClient/Object/EnumTest.pm
lib/WWW/OpenAPIClient/Object/FakeBigDecimalMap200Response.pm
lib/WWW/OpenAPIClient/Object/File.pm
lib/WWW/OpenAPIClient/Object/FileSchemaTestClass.pm
lib/WWW/OpenAPIClient/Object/Foo.pm

View File

@ -261,6 +261,7 @@ use WWW::OpenAPIClient::Object::DogAllOf;
use WWW::OpenAPIClient::Object::EnumArrays;
use WWW::OpenAPIClient::Object::EnumClass;
use WWW::OpenAPIClient::Object::EnumTest;
use WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response;
use WWW::OpenAPIClient::Object::File;
use WWW::OpenAPIClient::Object::FileSchemaTestClass;
use WWW::OpenAPIClient::Object::Foo;
@ -329,6 +330,7 @@ use WWW::OpenAPIClient::Object::DogAllOf;
use WWW::OpenAPIClient::Object::EnumArrays;
use WWW::OpenAPIClient::Object::EnumClass;
use WWW::OpenAPIClient::Object::EnumTest;
use WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response;
use WWW::OpenAPIClient::Object::File;
use WWW::OpenAPIClient::Object::FileSchemaTestClass;
use WWW::OpenAPIClient::Object::Foo;
@ -386,6 +388,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
*FakeApi* | [**fake_big_decimal_map**](docs/FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
@ -447,6 +450,7 @@ Class | Method | HTTP request | Description
- [WWW::OpenAPIClient::Object::EnumArrays](docs/EnumArrays.md)
- [WWW::OpenAPIClient::Object::EnumClass](docs/EnumClass.md)
- [WWW::OpenAPIClient::Object::EnumTest](docs/EnumTest.md)
- [WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [WWW::OpenAPIClient::Object::File](docs/File.md)
- [WWW::OpenAPIClient::Object::FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [WWW::OpenAPIClient::Object::Foo](docs/Foo.md)

View File

@ -9,6 +9,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**fake_big_decimal_map**](FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap |
[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
@ -28,6 +29,48 @@ Method | HTTP request | Description
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
# **fake_big_decimal_map**
> FakeBigDecimalMap200Response fake_big_decimal_map()
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```perl
use Data::Dumper;
use WWW::OpenAPIClient::FakeApi;
my $api_instance = WWW::OpenAPIClient::FakeApi->new(
);
eval {
my $result = $api_instance->fake_big_decimal_map();
print Dumper($result);
};
if ($@) {
warn "Exception when calling FakeApi->fake_big_decimal_map: $@\n";
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fake_health_get**
> HealthCheckResult fake_health_get()

View File

@ -0,0 +1,16 @@
# WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response
## Load the model package
```perl
use WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**some_id** | **double** | | [optional]
**some_map** | **HASH[string,double]** | | [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)

View File

@ -48,6 +48,55 @@ sub new {
}
#
# fake_big_decimal_map
#
#
#
{
my $params = {
};
__PACKAGE__->method_documentation->{ 'fake_big_decimal_map' } = {
summary => '',
params => $params,
returns => 'FakeBigDecimalMap200Response',
};
}
# @return FakeBigDecimalMap200Response
#
sub fake_big_decimal_map {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/fake/BigDecimalMap';
my $_method = 'GET';
my $query_params = {};
my $header_params = {};
my $form_params = {};
# 'Accept' and 'Content-Type' header
my $_header_accept = $self->{api_client}->select_header_accept('*/*');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw()];
# make the API Call
my $response = $self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
if (!$response) {
return;
}
my $_response_object = $self->{api_client}->deserialize('FakeBigDecimalMap200Response', $response);
return $_response_object;
}
#
# fake_health_get
#

View File

@ -0,0 +1,251 @@
=begin comment
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
=end comment
=cut
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# Do not edit the class manually.
# Ref: https://openapi-generator.tech
#
package WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Date::Parse;
use DateTime;
use base ("Class::Accessor", "Class::Data::Inheritable");
#
#
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
# REF: https://openapi-generator.tech
#
=begin comment
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
=end comment
=cut
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# Do not edit the class manually.
# Ref: https://openapi-generator.tech
#
__PACKAGE__->mk_classdata('attribute_map' => {});
__PACKAGE__->mk_classdata('openapi_types' => {});
__PACKAGE__->mk_classdata('method_documentation' => {});
__PACKAGE__->mk_classdata('class_documentation' => {});
# new plain object
sub new {
my ($class, %args) = @_;
my $self = bless {}, $class;
$self->init(%args);
return $self;
}
# initialize the object
sub init
{
my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } );
}
}
# return perl hash
sub to_hash {
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
foreach my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
my $_value = $self->{$_key};
if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = $1;
$_data->{$_json_attribute} = [ map { $self->_to_json_primitives($_subclass, $_) } @$_value ];
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
my $_subclass = $1;
my %_hash = ();
while (my($_key, $_element) = each %{$_value}) {
$_hash{$_key} = $self->_to_json_primitives($_subclass, $_element);
}
$_data->{$_json_attribute} = \%_hash;
} elsif ( grep( /^$_type$/, ('int', 'double', 'string', 'boolean', 'DATE', 'DATE_TIME'))) {
$_data->{$_json_attribute} = $self->_to_json_primitives($_type, $_value);
} else {
$_data->{$_json_attribute} = $_value;
}
}
}
return $_data;
}
# to_json non-array data
sub _to_json_primitives {
my ($self, $type, $data) = @_;
if ( grep( /^$type$/, ('int', 'double'))) {
# https://metacpan.org/pod/JSON#simple-scalars
# numify it, ensuring it will be dumped as a number
return undef unless defined $data;
return $data + 0;
} elsif ($type eq 'string') {
# https://metacpan.org/pod/JSON#simple-scalars
# stringified
return undef unless defined $data;
return $data . q();
} elsif ($type eq 'boolean') {
# https://metacpan.org/pod/JSON#JSON::true,-JSON::false,-JSON::null
return $data ? \1 : \0;
} elsif ($type eq 'DATE') {
return undef unless defined $data;
if (ref($data) eq 'DateTime') {
# https://metacpan.org/pod/DateTime#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...)
return $data->ymd;
}
return $data .q();
} elsif ($type eq 'DATE_TIME') {
return undef unless defined $data;
# the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z
if (ref($data) eq 'DateTime') {
# https://metacpan.org/pod/DateTime#$dt-%3Erfc3339
return $data->rfc3339;
}
return $data .q();
} else { # hash (model), In this case, the TO_JSON of the $data object is executed
return $data;
}
}
# from Perl hashref
sub from_hash {
my ($self, $hash) = @_;
# loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = $1;
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
my $_subclass = $1;
my %_hash = ();
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \%_hash;
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
}
}
return $self;
}
# deserialize non-array data
sub _deserialize {
my ($self, $type, $data) = @_;
$log->debugf("deserializing %s with %s",Dumper($data), $type);
if (grep( /^$type$/ , ('DATE_TIME', 'DATE'))) {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('int', 'double'))) {
return undef unless defined $data;
return $data + 0;
} elsif ($type eq 'string') {
return undef unless defined $data;
return $data . q();
} elsif ($type eq 'boolean') {
return !!$data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'FakeBigDecimalMap200Response',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'some_id' => {
datatype => 'double',
base_name => 'someId',
description => '',
format => '',
read_only => '',
},
'some_map' => {
datatype => 'HASH[string,double]',
base_name => 'someMap',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'some_id' => 'double',
'some_map' => 'HASH[string,double]'
} );
__PACKAGE__->attribute_map( {
'some_id' => 'someId',
'some_map' => 'someMap'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,34 @@
=begin comment
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
=end comment
=cut
#
# NOTE: This class is auto generated by the OpenAPI Generator
# Please update the test cases below to test the model.
# Ref: https://openapi-generator.tech
#
use Test::More tests => 2;
use Test::Exception;
use lib 'lib';
use strict;
use warnings;
use_ok('WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response');
# uncomment below and update the test
#my $instance = WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response->new();
#
#isa_ok($instance, 'WWW::OpenAPIClient::Object::FakeBigDecimalMap200Response');

View File

@ -29,6 +29,7 @@ docs/Model/DogAllOf.md
docs/Model/EnumArrays.md
docs/Model/EnumClass.md
docs/Model/EnumTest.md
docs/Model/FakeBigDecimalMap200Response.md
docs/Model/File.md
docs/Model/FileSchemaTestClass.md
docs/Model/Foo.md
@ -88,6 +89,7 @@ lib/Model/DogAllOf.php
lib/Model/EnumArrays.php
lib/Model/EnumClass.php
lib/Model/EnumTest.php
lib/Model/FakeBigDecimalMap200Response.php
lib/Model/File.php
lib/Model/FileSchemaTestClass.php
lib/Model/Foo.php

View File

@ -74,6 +74,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123TestSpecialTags**](docs/Api/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/Api/DefaultApi.md#fooget) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/Api/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeHealthGet**](docs/Api/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](docs/Api/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
@ -135,6 +136,7 @@ Class | Method | HTTP request | Description
- [EnumArrays](docs/Model/EnumArrays.md)
- [EnumClass](docs/Model/EnumClass.md)
- [EnumTest](docs/Model/EnumTest.md)
- [FakeBigDecimalMap200Response](docs/Model/FakeBigDecimalMap200Response.md)
- [File](docs/Model/File.md)
- [FileSchemaTestClass](docs/Model/FileSchemaTestClass.md)
- [Foo](docs/Model/Foo.md)

View File

@ -4,6 +4,7 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**fakeBigDecimalMap()**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeHealthGet()**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest()**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fakeOuterBooleanSerialize()**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
@ -23,6 +24,59 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati
| [**testQueryParameterCollectionFormat()**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | |
## `fakeBigDecimalMap()`
```php
fakeBigDecimalMap(): \OpenAPI\Client\Model\FakeBigDecimalMap200Response
```
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\FakeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
try {
$result = $apiInstance->fakeBigDecimalMap();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FakeApi->fakeBigDecimalMap: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**\OpenAPI\Client\Model\FakeBigDecimalMap200Response**](../Model/FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `*/*`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `fakeHealthGet()`
```php

View File

@ -0,0 +1,10 @@
# # FakeBigDecimalMap200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**some_id** | **float** | | [optional]
**some_map** | **array<string,float>** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View File

@ -71,6 +71,9 @@ class FakeApi
/** @var string[] $contentTypes **/
public const contentTypes = [
'fakeBigDecimalMap' => [
'application/json',
],
'fakeHealthGet' => [
'application/json',
],
@ -171,6 +174,261 @@ class FakeApi
return $this->config;
}
/**
* Operation fakeBigDecimalMap
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeBigDecimalMap'] to see the possible values for this operation
*
* @throws \OpenAPI\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \OpenAPI\Client\Model\FakeBigDecimalMap200Response
*/
public function fakeBigDecimalMap(string $contentType = self::contentTypes['fakeBigDecimalMap'][0])
{
list($response) = $this->fakeBigDecimalMapWithHttpInfo($contentType);
return $response;
}
/**
* Operation fakeBigDecimalMapWithHttpInfo
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeBigDecimalMap'] to see the possible values for this operation
*
* @throws \OpenAPI\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \OpenAPI\Client\Model\FakeBigDecimalMap200Response, HTTP status code, HTTP response headers (array of strings)
*/
public function fakeBigDecimalMapWithHttpInfo(string $contentType = self::contentTypes['fakeBigDecimalMap'][0])
{
$request = $this->fakeBigDecimalMapRequest($contentType);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
switch($statusCode) {
case 200:
if ('\OpenAPI\Client\Model\FakeBigDecimalMap200Response' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('\OpenAPI\Client\Model\FakeBigDecimalMap200Response' !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FakeBigDecimalMap200Response', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\OpenAPI\Client\Model\FakeBigDecimalMap200Response';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\OpenAPI\Client\Model\FakeBigDecimalMap200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
}
/**
* Operation fakeBigDecimalMapAsync
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeBigDecimalMap'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function fakeBigDecimalMapAsync(string $contentType = self::contentTypes['fakeBigDecimalMap'][0])
{
return $this->fakeBigDecimalMapAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
}
);
}
/**
* Operation fakeBigDecimalMapAsyncWithHttpInfo
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeBigDecimalMap'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function fakeBigDecimalMapAsyncWithHttpInfo(string $contentType = self::contentTypes['fakeBigDecimalMap'][0])
{
$returnType = '\OpenAPI\Client\Model\FakeBigDecimalMap200Response';
$request = $this->fakeBigDecimalMapRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
}
/**
* Create request for operation 'fakeBigDecimalMap'
*
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeBigDecimalMap'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function fakeBigDecimalMapRequest(string $contentType = self::contentTypes['fakeBigDecimalMap'][0])
{
$resourcePath = '/fake/BigDecimalMap';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
$headers = $this->headerSelector->selectHeaders(
['*/*', ],
$contentType,
$multipart
);
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$operationHost = $this->config->getHost();
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
* Operation fakeHealthGet
*

View File

@ -0,0 +1,443 @@
<?php
/**
* FakeBigDecimalMap200Response
*
* PHP version 7.4
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 7.0.0-SNAPSHOT
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use \ArrayAccess;
use \OpenAPI\Client\ObjectSerializer;
/**
* FakeBigDecimalMap200Response Class Doc Comment
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements \ArrayAccess<string, mixed>
*/
class FakeBigDecimalMap200Response implements ModelInterface, ArrayAccess, \JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $openAPIModelName = 'fakeBigDecimalMap_200_response';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPITypes = [
'some_id' => 'float',
'some_map' => 'array<string,float>'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
* @phpstan-var array<string, string|null>
* @psalm-var array<string, string|null>
*/
protected static $openAPIFormats = [
'some_id' => null,
'some_map' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var boolean[]
*/
protected static array $openAPINullables = [
'some_id' => false,
'some_map' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var boolean[]
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPITypes()
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPIFormats()
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return boolean[]
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param boolean[] $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'some_id' => 'someId',
'some_map' => 'someMap'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'some_id' => 'setSomeId',
'some_map' => 'setSomeMap'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'some_id' => 'getSomeId',
'some_map' => 'getSomeMap'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->setIfExists('some_id', $data ?? [], null);
$this->setIfExists('some_map', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets some_id
*
* @return float|null
*/
public function getSomeId()
{
return $this->container['some_id'];
}
/**
* Sets some_id
*
* @param float|null $some_id some_id
*
* @return self
*/
public function setSomeId($some_id)
{
if (is_null($some_id)) {
throw new \InvalidArgumentException('non-nullable some_id cannot be null');
}
$this->container['some_id'] = $some_id;
return $this;
}
/**
* Gets some_map
*
* @return array<string,float>|null
*/
public function getSomeMap()
{
return $this->container['some_map'];
}
/**
* Sets some_map
*
* @param array<string,float>|null $some_map some_map
*
* @return self
*/
public function setSomeMap($some_map)
{
if (is_null($some_map)) {
throw new \InvalidArgumentException('non-nullable some_map cannot be null');
}
$this->container['some_map'] = $some_map;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue()
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@ -0,0 +1,99 @@
<?php
/**
* FakeBigDecimalMap200ResponseTest
*
* PHP version 7.4
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 7.0.0-SNAPSHOT
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Please update the test case below to test the model.
*/
namespace OpenAPI\Client\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* FakeBigDecimalMap200ResponseTest Class Doc Comment
*
* @category Class
* @description FakeBigDecimalMap200Response
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class FakeBigDecimalMap200ResponseTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "FakeBigDecimalMap200Response"
*/
public function testFakeBigDecimalMap200Response()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
}
/**
* Test attribute "some_id"
*/
public function testPropertySomeId()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
}
/**
* Test attribute "some_map"
*/
public function testPropertySomeMap()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
}
}

View File

@ -28,6 +28,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
@ -92,6 +93,7 @@ lib/petstore/models/dog_all_of.rb
lib/petstore/models/enum_arrays.rb
lib/petstore/models/enum_class.rb
lib/petstore/models/enum_test.rb
lib/petstore/models/fake_big_decimal_map200_response.rb
lib/petstore/models/file.rb
lib/petstore/models/file_schema_test_class.rb
lib/petstore/models/foo.rb

View File

@ -77,6 +77,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
*Petstore::FakeApi* | [**fake_big_decimal_map**](docs/FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap |
*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
@ -139,6 +140,7 @@ Class | Method | HTTP request | Description
- [Petstore::EnumArrays](docs/EnumArrays.md)
- [Petstore::EnumClass](docs/EnumClass.md)
- [Petstore::EnumTest](docs/EnumTest.md)
- [Petstore::FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [Petstore::File](docs/File.md)
- [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Petstore::Foo](docs/Foo.md)

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
| [**fake_big_decimal_map**](FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap | |
| [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint |
| [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | |
@ -23,6 +24,67 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | |
## fake_big_decimal_map
> <FakeBigDecimalMap200Response> fake_big_decimal_map
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Examples
```ruby
require 'time'
require 'petstore'
api_instance = Petstore::FakeApi.new
begin
result = api_instance.fake_big_decimal_map
p result
rescue Petstore::ApiError => e
puts "Error when calling FakeApi->fake_big_decimal_map: #{e}"
end
```
#### Using the fake_big_decimal_map_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> <Array(<FakeBigDecimalMap200Response>, Integer, Hash)> fake_big_decimal_map_with_http_info
```ruby
begin
data, status_code, headers = api_instance.fake_big_decimal_map_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <FakeBigDecimalMap200Response>
rescue Petstore::ApiError => e
puts "Error when calling FakeApi->fake_big_decimal_map_with_http_info: #{e}"
end
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
## fake_health_get
> <HealthCheckResult> fake_health_get

View File

@ -0,0 +1,20 @@
# Petstore::FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **some_id** | **Float** | | [optional] |
| **some_map** | **Hash&lt;String, Float&gt;** | | [optional] |
## Example
```ruby
require 'petstore'
instance = Petstore::FakeBigDecimalMap200Response.new(
some_id: null,
some_map: null
)
```

View File

@ -36,6 +36,7 @@ Petstore.autoload :DogAllOf, 'petstore/models/dog_all_of'
Petstore.autoload :EnumArrays, 'petstore/models/enum_arrays'
Petstore.autoload :EnumClass, 'petstore/models/enum_class'
Petstore.autoload :EnumTest, 'petstore/models/enum_test'
Petstore.autoload :FakeBigDecimalMap200Response, 'petstore/models/fake_big_decimal_map200_response'
Petstore.autoload :File, 'petstore/models/file'
Petstore.autoload :FileSchemaTestClass, 'petstore/models/file_schema_test_class'
Petstore.autoload :Foo, 'petstore/models/foo'

View File

@ -19,6 +19,61 @@ module Petstore
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
# @param [Hash] opts the optional parameters
# @return [FakeBigDecimalMap200Response]
def fake_big_decimal_map(opts = {})
data, _status_code, _headers = fake_big_decimal_map_with_http_info(opts)
data
end
# for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
# @param [Hash] opts the optional parameters
# @return [Array<(FakeBigDecimalMap200Response, Integer, Hash)>] FakeBigDecimalMap200Response data, response status code and response headers
def fake_big_decimal_map_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FakeApi.fake_big_decimal_map ...'
end
# resource path
local_var_path = '/fake/BigDecimalMap'
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'FakeBigDecimalMap200Response'
# auth_names
auth_names = opts[:debug_auth_names] || []
new_options = opts.merge(
:operation => :"FakeApi.fake_big_decimal_map",
: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(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FakeApi#fake_big_decimal_map\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Health check endpoint
# @param [Hash] opts the optional parameters
# @return [HealthCheckResult]

View File

@ -0,0 +1,230 @@
=begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end
require 'date'
require 'time'
module Petstore
class FakeBigDecimalMap200Response
attr_accessor :some_id
attr_accessor :some_map
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'some_id' => :'someId',
:'some_map' => :'someMap'
}
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
end
# Attribute type mapping.
def self.openapi_types
{
:'some_id' => :'Float',
:'some_map' => :'Hash<String, Float>'
}
end
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
])
end
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FakeBigDecimalMap200Response` initialize method"
end
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FakeBigDecimalMap200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}
if attributes.key?(:'some_id')
self.some_id = attributes[:'some_id']
end
if attributes.key?(:'some_map')
if (value = attributes[:'some_map']).is_a?(Hash)
self.some_map = value
end
end
end
# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
invalid_properties = Array.new
invalid_properties
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
true
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
some_id == o.some_id &&
some_map == o.some_map
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
self == o
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[some_id, some_map].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
def self.build_from_hash(attributes)
new.build_from_hash(attributes)
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)
attributes = attributes.transform_keys(&:to_sym)
self.class.openapi_types.each_pair do |key, type|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
self.send("#{key}=", nil)
elsif type =~ /\AArray<(.*)>/i
# check to ensure the input is an array given that the attribute
# is documented as an array but the input is not
if attributes[self.class.attribute_map[key]].is_a?(Array)
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
end
elsif !attributes[self.class.attribute_map[key]].nil?
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
end
end
self
end
# Deserializes the data based on type
# @param string type Data type
# @param string value Value to be deserialized
# @return [Object] Deserialized data
def _deserialize(type, value)
case type.to_sym
when :Time
Time.parse(value)
when :Date
Date.parse(value)
when :String
value.to_s
when :Integer
value.to_i
when :Float
value.to_f
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
false
end
when :Object
# generic object (usually a Hash), return directly
value
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
k_type = Regexp.last_match[:k_type]
v_type = Regexp.last_match[:v_type]
{}.tap do |hash|
value.each do |k, v|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
end
end
else # model
# models (e.g. Pet) or oneOf
klass = Petstore.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
end
end
# Returns the string representation of the object
# @return [String] String presentation of the object
def to_s
to_hash.to_s
end
# to_body is an alias to to_hash (backward compatibility)
# @return [Hash] Returns the object in the form of hash
def to_body
to_hash
end
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end
hash[param] = _to_hash(value)
end
hash
end
# Outputs non-array value in the form of hash
# For object, use to_hash. Otherwise, just return the value
# @param [Object] value Any valid value
# @return [Hash] Returns the value in the form of hash
def _to_hash(value)
if value.is_a?(Array)
value.compact.map { |v| _to_hash(v) }
elsif value.is_a?(Hash)
{}.tap do |hash|
value.each { |k, v| hash[k] = _to_hash(v) }
end
elsif value.respond_to? :to_hash
value.to_hash
else
value
end
end
end
end

View File

@ -0,0 +1,40 @@
=begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Petstore::FakeBigDecimalMap200Response
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe Petstore::FakeBigDecimalMap200Response do
let(:instance) { Petstore::FakeBigDecimalMap200Response.new }
describe 'test an instance of FakeBigDecimalMap200Response' do
it 'should create an instance of FakeBigDecimalMap200Response' do
expect(instance).to be_instance_of(Petstore::FakeBigDecimalMap200Response)
end
end
describe 'test attribute "some_id"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end
describe 'test attribute "some_map"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end
end

View File

@ -28,6 +28,7 @@ docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
docs/FakeApi.md
docs/FakeBigDecimalMap200Response.md
docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
@ -92,6 +93,7 @@ lib/petstore/models/dog_all_of.rb
lib/petstore/models/enum_arrays.rb
lib/petstore/models/enum_class.rb
lib/petstore/models/enum_test.rb
lib/petstore/models/fake_big_decimal_map200_response.rb
lib/petstore/models/file.rb
lib/petstore/models/file_schema_test_class.rb
lib/petstore/models/foo.rb

View File

@ -77,6 +77,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
*Petstore::FakeApi* | [**fake_big_decimal_map**](docs/FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap |
*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
@ -139,6 +140,7 @@ Class | Method | HTTP request | Description
- [Petstore::EnumArrays](docs/EnumArrays.md)
- [Petstore::EnumClass](docs/EnumClass.md)
- [Petstore::EnumTest](docs/EnumTest.md)
- [Petstore::FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
- [Petstore::File](docs/File.md)
- [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Petstore::Foo](docs/Foo.md)

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
| [**fake_big_decimal_map**](FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap | |
| [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint |
| [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication |
| [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | |
@ -23,6 +24,67 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | |
## fake_big_decimal_map
> <FakeBigDecimalMap200Response> fake_big_decimal_map
for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
### Examples
```ruby
require 'time'
require 'petstore'
api_instance = Petstore::FakeApi.new
begin
result = api_instance.fake_big_decimal_map
p result
rescue Petstore::ApiError => e
puts "Error when calling FakeApi->fake_big_decimal_map: #{e}"
end
```
#### Using the fake_big_decimal_map_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> <Array(<FakeBigDecimalMap200Response>, Integer, Hash)> fake_big_decimal_map_with_http_info
```ruby
begin
data, status_code, headers = api_instance.fake_big_decimal_map_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <FakeBigDecimalMap200Response>
rescue Petstore::ApiError => e
puts "Error when calling FakeApi->fake_big_decimal_map_with_http_info: #{e}"
end
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
## fake_health_get
> <HealthCheckResult> fake_health_get

View File

@ -0,0 +1,20 @@
# Petstore::FakeBigDecimalMap200Response
## Properties
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **some_id** | **Float** | | [optional] |
| **some_map** | **Hash&lt;String, Float&gt;** | | [optional] |
## Example
```ruby
require 'petstore'
instance = Petstore::FakeBigDecimalMap200Response.new(
some_id: null,
some_map: null
)
```

Some files were not shown because too many files have changed in this diff Show More