Bugfix(Perl): Support nested primitive types in ARRARY or HASH for basic object (#2713)

* support nested primitive types in ARRARY or HASH for basic object

* run bin/perl-petstore.sh and bin/openapi3/{LANG}-petstore.sh
This commit is contained in:
Min Kim 2019-04-23 04:19:16 -04:00 committed by William Cheng
parent a4be2c0bb4
commit 06fdc925a5
106 changed files with 4906 additions and 550 deletions

View File

@ -74,13 +74,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -222,6 +222,7 @@ Each of these calls returns a hashref with various useful pieces of information.
To load the API packages: To load the API packages:
```perl ```perl
use WWW::OpenAPIClient::AnotherFakeApi; use WWW::OpenAPIClient::AnotherFakeApi;
use WWW::OpenAPIClient::DefaultApi;
use WWW::OpenAPIClient::FakeApi; use WWW::OpenAPIClient::FakeApi;
use WWW::OpenAPIClient::FakeClassnameTags123Api; use WWW::OpenAPIClient::FakeClassnameTags123Api;
use WWW::OpenAPIClient::PetApi; use WWW::OpenAPIClient::PetApi;
@ -249,18 +250,31 @@ use WWW::OpenAPIClient::Object::EnumClass;
use WWW::OpenAPIClient::Object::EnumTest; use WWW::OpenAPIClient::Object::EnumTest;
use WWW::OpenAPIClient::Object::File; use WWW::OpenAPIClient::Object::File;
use WWW::OpenAPIClient::Object::FileSchemaTestClass; use WWW::OpenAPIClient::Object::FileSchemaTestClass;
use WWW::OpenAPIClient::Object::Foo;
use WWW::OpenAPIClient::Object::FormatTest; use WWW::OpenAPIClient::Object::FormatTest;
use WWW::OpenAPIClient::Object::HasOnlyReadOnly; use WWW::OpenAPIClient::Object::HasOnlyReadOnly;
use WWW::OpenAPIClient::Object::HealthCheckResult;
use WWW::OpenAPIClient::Object::InlineObject;
use WWW::OpenAPIClient::Object::InlineObject1;
use WWW::OpenAPIClient::Object::InlineObject2;
use WWW::OpenAPIClient::Object::InlineObject3;
use WWW::OpenAPIClient::Object::InlineObject4;
use WWW::OpenAPIClient::Object::InlineObject5;
use WWW::OpenAPIClient::Object::InlineResponseDefault;
use WWW::OpenAPIClient::Object::List; use WWW::OpenAPIClient::Object::List;
use WWW::OpenAPIClient::Object::MapTest; use WWW::OpenAPIClient::Object::MapTest;
use WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass; use WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass;
use WWW::OpenAPIClient::Object::Model200Response; use WWW::OpenAPIClient::Object::Model200Response;
use WWW::OpenAPIClient::Object::ModelReturn; use WWW::OpenAPIClient::Object::ModelReturn;
use WWW::OpenAPIClient::Object::Name; use WWW::OpenAPIClient::Object::Name;
use WWW::OpenAPIClient::Object::NullableClass;
use WWW::OpenAPIClient::Object::NumberOnly; use WWW::OpenAPIClient::Object::NumberOnly;
use WWW::OpenAPIClient::Object::Order; use WWW::OpenAPIClient::Object::Order;
use WWW::OpenAPIClient::Object::OuterComposite; use WWW::OpenAPIClient::Object::OuterComposite;
use WWW::OpenAPIClient::Object::OuterEnum; use WWW::OpenAPIClient::Object::OuterEnum;
use WWW::OpenAPIClient::Object::OuterEnumDefaultValue;
use WWW::OpenAPIClient::Object::OuterEnumInteger;
use WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue;
use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::Pet;
use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::ReadOnlyFirst;
use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::SpecialModelName;
@ -278,6 +292,7 @@ use strict;
use warnings; use warnings;
# load the API package # load the API package
use WWW::OpenAPIClient::AnotherFakeApi; use WWW::OpenAPIClient::AnotherFakeApi;
use WWW::OpenAPIClient::DefaultApi;
use WWW::OpenAPIClient::FakeApi; use WWW::OpenAPIClient::FakeApi;
use WWW::OpenAPIClient::FakeClassnameTags123Api; use WWW::OpenAPIClient::FakeClassnameTags123Api;
use WWW::OpenAPIClient::PetApi; use WWW::OpenAPIClient::PetApi;
@ -302,18 +317,31 @@ use WWW::OpenAPIClient::Object::EnumClass;
use WWW::OpenAPIClient::Object::EnumTest; use WWW::OpenAPIClient::Object::EnumTest;
use WWW::OpenAPIClient::Object::File; use WWW::OpenAPIClient::Object::File;
use WWW::OpenAPIClient::Object::FileSchemaTestClass; use WWW::OpenAPIClient::Object::FileSchemaTestClass;
use WWW::OpenAPIClient::Object::Foo;
use WWW::OpenAPIClient::Object::FormatTest; use WWW::OpenAPIClient::Object::FormatTest;
use WWW::OpenAPIClient::Object::HasOnlyReadOnly; use WWW::OpenAPIClient::Object::HasOnlyReadOnly;
use WWW::OpenAPIClient::Object::HealthCheckResult;
use WWW::OpenAPIClient::Object::InlineObject;
use WWW::OpenAPIClient::Object::InlineObject1;
use WWW::OpenAPIClient::Object::InlineObject2;
use WWW::OpenAPIClient::Object::InlineObject3;
use WWW::OpenAPIClient::Object::InlineObject4;
use WWW::OpenAPIClient::Object::InlineObject5;
use WWW::OpenAPIClient::Object::InlineResponseDefault;
use WWW::OpenAPIClient::Object::List; use WWW::OpenAPIClient::Object::List;
use WWW::OpenAPIClient::Object::MapTest; use WWW::OpenAPIClient::Object::MapTest;
use WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass; use WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass;
use WWW::OpenAPIClient::Object::Model200Response; use WWW::OpenAPIClient::Object::Model200Response;
use WWW::OpenAPIClient::Object::ModelReturn; use WWW::OpenAPIClient::Object::ModelReturn;
use WWW::OpenAPIClient::Object::Name; use WWW::OpenAPIClient::Object::Name;
use WWW::OpenAPIClient::Object::NullableClass;
use WWW::OpenAPIClient::Object::NumberOnly; use WWW::OpenAPIClient::Object::NumberOnly;
use WWW::OpenAPIClient::Object::Order; use WWW::OpenAPIClient::Object::Order;
use WWW::OpenAPIClient::Object::OuterComposite; use WWW::OpenAPIClient::Object::OuterComposite;
use WWW::OpenAPIClient::Object::OuterEnum; use WWW::OpenAPIClient::Object::OuterEnum;
use WWW::OpenAPIClient::Object::OuterEnumDefaultValue;
use WWW::OpenAPIClient::Object::OuterEnumInteger;
use WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue;
use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::Pet;
use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::ReadOnlyFirst;
use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::SpecialModelName;
@ -327,10 +355,10 @@ use WWW::OpenAPIClient::;
my $api_instance = WWW::OpenAPIClient::->new( my $api_instance = WWW::OpenAPIClient::->new(
); );
my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model
eval { eval {
my $result = $api_instance->call_123_test_special_tags(body => $body); my $result = $api_instance->call_123_test_special_tags(client => $client);
print Dumper($result); print Dumper($result);
}; };
if ($@) { if ($@) {
@ -346,6 +374,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description 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 *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_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
@ -400,18 +430,31 @@ Class | Method | HTTP request | Description
- [WWW::OpenAPIClient::Object::EnumTest](docs/EnumTest.md) - [WWW::OpenAPIClient::Object::EnumTest](docs/EnumTest.md)
- [WWW::OpenAPIClient::Object::File](docs/File.md) - [WWW::OpenAPIClient::Object::File](docs/File.md)
- [WWW::OpenAPIClient::Object::FileSchemaTestClass](docs/FileSchemaTestClass.md) - [WWW::OpenAPIClient::Object::FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [WWW::OpenAPIClient::Object::Foo](docs/Foo.md)
- [WWW::OpenAPIClient::Object::FormatTest](docs/FormatTest.md) - [WWW::OpenAPIClient::Object::FormatTest](docs/FormatTest.md)
- [WWW::OpenAPIClient::Object::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [WWW::OpenAPIClient::Object::HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [WWW::OpenAPIClient::Object::HealthCheckResult](docs/HealthCheckResult.md)
- [WWW::OpenAPIClient::Object::InlineObject](docs/InlineObject.md)
- [WWW::OpenAPIClient::Object::InlineObject1](docs/InlineObject1.md)
- [WWW::OpenAPIClient::Object::InlineObject2](docs/InlineObject2.md)
- [WWW::OpenAPIClient::Object::InlineObject3](docs/InlineObject3.md)
- [WWW::OpenAPIClient::Object::InlineObject4](docs/InlineObject4.md)
- [WWW::OpenAPIClient::Object::InlineObject5](docs/InlineObject5.md)
- [WWW::OpenAPIClient::Object::InlineResponseDefault](docs/InlineResponseDefault.md)
- [WWW::OpenAPIClient::Object::List](docs/List.md) - [WWW::OpenAPIClient::Object::List](docs/List.md)
- [WWW::OpenAPIClient::Object::MapTest](docs/MapTest.md) - [WWW::OpenAPIClient::Object::MapTest](docs/MapTest.md)
- [WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [WWW::OpenAPIClient::Object::Model200Response](docs/Model200Response.md) - [WWW::OpenAPIClient::Object::Model200Response](docs/Model200Response.md)
- [WWW::OpenAPIClient::Object::ModelReturn](docs/ModelReturn.md) - [WWW::OpenAPIClient::Object::ModelReturn](docs/ModelReturn.md)
- [WWW::OpenAPIClient::Object::Name](docs/Name.md) - [WWW::OpenAPIClient::Object::Name](docs/Name.md)
- [WWW::OpenAPIClient::Object::NullableClass](docs/NullableClass.md)
- [WWW::OpenAPIClient::Object::NumberOnly](docs/NumberOnly.md) - [WWW::OpenAPIClient::Object::NumberOnly](docs/NumberOnly.md)
- [WWW::OpenAPIClient::Object::Order](docs/Order.md) - [WWW::OpenAPIClient::Object::Order](docs/Order.md)
- [WWW::OpenAPIClient::Object::OuterComposite](docs/OuterComposite.md) - [WWW::OpenAPIClient::Object::OuterComposite](docs/OuterComposite.md)
- [WWW::OpenAPIClient::Object::OuterEnum](docs/OuterEnum.md) - [WWW::OpenAPIClient::Object::OuterEnum](docs/OuterEnum.md)
- [WWW::OpenAPIClient::Object::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
- [WWW::OpenAPIClient::Object::OuterEnumInteger](docs/OuterEnumInteger.md)
- [WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
- [WWW::OpenAPIClient::Object::Pet](docs/Pet.md) - [WWW::OpenAPIClient::Object::Pet](docs/Pet.md)
- [WWW::OpenAPIClient::Object::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [WWW::OpenAPIClient::Object::ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [WWW::OpenAPIClient::Object::SpecialModelName](docs/SpecialModelName.md) - [WWW::OpenAPIClient::Object::SpecialModelName](docs/SpecialModelName.md)
@ -433,6 +476,10 @@ Class | Method | HTTP request | Description
- **API key parameter name**: api_key_query - **API key parameter name**: api_key_query
- **Location**: URL query string - **Location**: URL query string
## bearer_test
- **Type**: HTTP basic authentication
## http_basic_test ## http_basic_test
- **Type**: HTTP basic authentication - **Type**: HTTP basic authentication

View File

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType
## Load the model package
```perl
use WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [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

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::AdditionalPropertiesArray
## Load the model package
```perl
use WWW::OpenAPIClient::Object::AdditionalPropertiesArray;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [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

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean
## Load the model package
```perl
use WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [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

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::AdditionalPropertiesInteger
## Load the model package
```perl
use WWW::OpenAPIClient::Object::AdditionalPropertiesInteger;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [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

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::AdditionalPropertiesNumber
## Load the model package
```perl
use WWW::OpenAPIClient::Object::AdditionalPropertiesNumber;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [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

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::AdditionalPropertiesObject
## Load the model package
```perl
use WWW::OpenAPIClient::Object::AdditionalPropertiesObject;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [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

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::AdditionalPropertiesString
## Load the model package
```perl
use WWW::OpenAPIClient::Object::AdditionalPropertiesString;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [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

@ -13,7 +13,7 @@ Method | HTTP request | Description
# **call_123_test_special_tags** # **call_123_test_special_tags**
> Client call_123_test_special_tags(body => $body) > Client call_123_test_special_tags(client => $client)
To test special tags To test special tags
@ -26,10 +26,10 @@ use WWW::OpenAPIClient::AnotherFakeApi;
my $api_instance = WWW::OpenAPIClient::AnotherFakeApi->new( my $api_instance = WWW::OpenAPIClient::AnotherFakeApi->new(
); );
my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model
eval { eval {
my $result = $api_instance->call_123_test_special_tags(body => $body); my $result = $api_instance->call_123_test_special_tags(client => $client);
print Dumper($result); print Dumper($result);
}; };
if ($@) { if ($@) {
@ -41,7 +41,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model | **client** | [**Client**](Client.md)| client model |
### Return type ### Return type

View File

@ -13,6 +13,9 @@ Name | Type | Description | Notes
**enum_integer** | **int** | | [optional] **enum_integer** | **int** | | [optional]
**enum_number** | **double** | | [optional] **enum_number** | **double** | | [optional]
**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [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) [[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

@ -9,6 +9,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
@ -23,6 +24,46 @@ Method | HTTP request | Description
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
# **fake_health_get**
> HealthCheckResult fake_health_get()
Health check endpoint
### Example
```perl
use Data::Dumper;
use WWW::OpenAPIClient::FakeApi;
my $api_instance = WWW::OpenAPIClient::FakeApi->new(
);
eval {
my $result = $api_instance->fake_health_get();
print Dumper($result);
};
if ($@) {
warn "Exception when calling FakeApi->fake_health_get: $@\n";
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**HealthCheckResult**](HealthCheckResult.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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_outer_boolean_serialize** # **fake_outer_boolean_serialize**
> boolean fake_outer_boolean_serialize(body => $body) > boolean fake_outer_boolean_serialize(body => $body)
@ -64,13 +105,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **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) [[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_outer_composite_serialize** # **fake_outer_composite_serialize**
> OuterComposite fake_outer_composite_serialize(body => $body) > OuterComposite fake_outer_composite_serialize(outer_composite => $outer_composite)
@ -83,10 +124,10 @@ use WWW::OpenAPIClient::FakeApi;
my $api_instance = WWW::OpenAPIClient::FakeApi->new( my $api_instance = WWW::OpenAPIClient::FakeApi->new(
); );
my $body = WWW::OpenAPIClient::Object::OuterComposite->new(); # OuterComposite | Input composite as post body my $outer_composite = WWW::OpenAPIClient::Object::OuterComposite->new(); # OuterComposite | Input composite as post body
eval { eval {
my $result = $api_instance->fake_outer_composite_serialize(body => $body); my $result = $api_instance->fake_outer_composite_serialize(outer_composite => $outer_composite);
print Dumper($result); print Dumper($result);
}; };
if ($@) { if ($@) {
@ -98,7 +139,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type ### Return type
@ -110,7 +151,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **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) [[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)
@ -156,7 +197,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **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) [[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)
@ -202,13 +243,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: */* - **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) [[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)
# **test_body_with_file_schema** # **test_body_with_file_schema**
> test_body_with_file_schema(body => $body) > test_body_with_file_schema(file_schema_test_class => $file_schema_test_class)
@ -221,10 +262,10 @@ use WWW::OpenAPIClient::FakeApi;
my $api_instance = WWW::OpenAPIClient::FakeApi->new( my $api_instance = WWW::OpenAPIClient::FakeApi->new(
); );
my $body = WWW::OpenAPIClient::Object::FileSchemaTestClass->new(); # FileSchemaTestClass | my $file_schema_test_class = WWW::OpenAPIClient::Object::FileSchemaTestClass->new(); # FileSchemaTestClass |
eval { eval {
$api_instance->test_body_with_file_schema(body => $body); $api_instance->test_body_with_file_schema(file_schema_test_class => $file_schema_test_class);
}; };
if ($@) { if ($@) {
warn "Exception when calling FakeApi->test_body_with_file_schema: $@\n"; warn "Exception when calling FakeApi->test_body_with_file_schema: $@\n";
@ -235,7 +276,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type ### Return type
@ -253,7 +294,7 @@ No authorization required
[[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) [[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)
# **test_body_with_query_params** # **test_body_with_query_params**
> test_body_with_query_params(query => $query, body => $body) > test_body_with_query_params(query => $query, user => $user)
@ -265,10 +306,10 @@ my $api_instance = WWW::OpenAPIClient::FakeApi->new(
); );
my $query = "query_example"; # string | my $query = "query_example"; # string |
my $body = WWW::OpenAPIClient::Object::User->new(); # User | my $user = WWW::OpenAPIClient::Object::User->new(); # User |
eval { eval {
$api_instance->test_body_with_query_params(query => $query, body => $body); $api_instance->test_body_with_query_params(query => $query, user => $user);
}; };
if ($@) { if ($@) {
warn "Exception when calling FakeApi->test_body_with_query_params: $@\n"; warn "Exception when calling FakeApi->test_body_with_query_params: $@\n";
@ -280,7 +321,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**query** | **string**| | **query** | **string**| |
**body** | [**User**](User.md)| | **user** | [**User**](User.md)| |
### Return type ### Return type
@ -298,7 +339,7 @@ No authorization required
[[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) [[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)
# **test_client_model** # **test_client_model**
> Client test_client_model(body => $body) > Client test_client_model(client => $client)
To test \"client\" model To test \"client\" model
@ -311,10 +352,10 @@ use WWW::OpenAPIClient::FakeApi;
my $api_instance = WWW::OpenAPIClient::FakeApi->new( my $api_instance = WWW::OpenAPIClient::FakeApi->new(
); );
my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model
eval { eval {
my $result = $api_instance->test_client_model(body => $body); my $result = $api_instance->test_client_model(client => $client);
print Dumper($result); print Dumper($result);
}; };
if ($@) { if ($@) {
@ -326,7 +367,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model | **client** | [**Client**](Client.md)| client model |
### Return type ### Return type
@ -489,6 +530,10 @@ Fake endpoint to test group parameters (optional)
use Data::Dumper; use Data::Dumper;
use WWW::OpenAPIClient::FakeApi; use WWW::OpenAPIClient::FakeApi;
my $api_instance = WWW::OpenAPIClient::FakeApi->new( my $api_instance = WWW::OpenAPIClient::FakeApi->new(
# Configure HTTP basic authorization: bearer_test
username => 'YOUR_USERNAME',
password => 'YOUR_PASSWORD',
); );
my $required_string_group = 56; # int | Required String in group parameters my $required_string_group = 56; # int | Required String in group parameters
@ -523,7 +568,7 @@ void (empty response body)
### Authorization ### Authorization
No authorization required [bearer_test](../README.md#bearer_test)
### HTTP request headers ### HTTP request headers
@ -533,7 +578,7 @@ No authorization required
[[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) [[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)
# **test_inline_additional_properties** # **test_inline_additional_properties**
> test_inline_additional_properties(param => $param) > test_inline_additional_properties(request_body => $request_body)
test inline additionalProperties test inline additionalProperties
@ -544,10 +589,10 @@ use WWW::OpenAPIClient::FakeApi;
my $api_instance = WWW::OpenAPIClient::FakeApi->new( my $api_instance = WWW::OpenAPIClient::FakeApi->new(
); );
my $param = WWW::OpenAPIClient::Object::HASH[string,string]->new(); # HASH[string,string] | request body my $request_body = WWW::OpenAPIClient::Object::HASH[string,string]->new(); # HASH[string,string] | request body
eval { eval {
$api_instance->test_inline_additional_properties(param => $param); $api_instance->test_inline_additional_properties(request_body => $request_body);
}; };
if ($@) { if ($@) {
warn "Exception when calling FakeApi->test_inline_additional_properties: $@\n"; warn "Exception when calling FakeApi->test_inline_additional_properties: $@\n";
@ -558,7 +603,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**param** | [**HASH[string,string]**](string.md)| request body | **request_body** | [**HASH[string,string]**](string.md)| request body |
### Return type ### Return type

View File

@ -13,7 +13,7 @@ Method | HTTP request | Description
# **test_classname** # **test_classname**
> Client test_classname(body => $body) > Client test_classname(client => $client)
To test class name in snake case To test class name in snake case
@ -31,10 +31,10 @@ my $api_instance = WWW::OpenAPIClient::FakeClassnameTags123Api->new(
#api_key_prefix => {'api_key_query' => 'Bearer'}, #api_key_prefix => {'api_key_query' => 'Bearer'},
); );
my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model
eval { eval {
my $result = $api_instance->test_classname(body => $body); my $result = $api_instance->test_classname(client => $client);
print Dumper($result); print Dumper($result);
}; };
if ($@) { if ($@) {
@ -46,7 +46,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model | **client** | [**Client**](Client.md)| client model |
### Return type ### Return type

View File

@ -21,6 +21,8 @@ Name | Type | Description | Notes
**date_time** | **DateTime** | | [optional] **date_time** | **DateTime** | | [optional]
**uuid** | **string** | | [optional] **uuid** | **string** | | [optional]
**password** | **string** | | **password** | **string** | |
**pattern_with_digits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [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) [[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

@ -0,0 +1,15 @@
# WWW::OpenAPIClient::Object::HealthCheckResult
## Load the model package
```perl
use WWW::OpenAPIClient::Object::HealthCheckResult;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**nullable_message** | **string** | | [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

@ -0,0 +1,26 @@
# WWW::OpenAPIClient::Object::NullableClass
## Load the model package
```perl
use WWW::OpenAPIClient::Object::NullableClass;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer_prop** | **int** | | [optional]
**number_prop** | **double** | | [optional]
**boolean_prop** | **boolean** | | [optional]
**string_prop** | **string** | | [optional]
**date_prop** | **DateTime** | | [optional]
**datetime_prop** | **DateTime** | | [optional]
**array_nullable_prop** | **ARRAY[object]** | | [optional]
**array_and_items_nullable_prop** | **ARRAY[object]** | | [optional]
**array_items_nullable** | **ARRAY[object]** | | [optional]
**object_nullable_prop** | **HASH[string,object]** | | [optional]
**object_and_items_nullable_prop** | **HASH[string,object]** | | [optional]
**object_items_nullable** | **HASH[string,object]** | | [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

@ -0,0 +1,14 @@
# WWW::OpenAPIClient::Object::OuterEnumDefaultValue
## Load the model package
```perl
use WWW::OpenAPIClient::Object::OuterEnumDefaultValue;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[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

@ -0,0 +1,14 @@
# WWW::OpenAPIClient::Object::OuterEnumInteger
## Load the model package
```perl
use WWW::OpenAPIClient::Object::OuterEnumInteger;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[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

@ -0,0 +1,14 @@
# WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue
## Load the model package
```perl
use WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[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

@ -21,7 +21,7 @@ Method | HTTP request | Description
# **add_pet** # **add_pet**
> add_pet(body => $body) > add_pet(pet => $pet)
Add a new pet to the store Add a new pet to the store
@ -35,10 +35,10 @@ my $api_instance = WWW::OpenAPIClient::PetApi->new(
access_token => 'YOUR_ACCESS_TOKEN', access_token => 'YOUR_ACCESS_TOKEN',
); );
my $body = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store my $pet = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
eval { eval {
$api_instance->add_pet(body => $body); $api_instance->add_pet(pet => $pet);
}; };
if ($@) { if ($@) {
warn "Exception when calling PetApi->add_pet: $@\n"; warn "Exception when calling PetApi->add_pet: $@\n";
@ -49,7 +49,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
@ -264,7 +264,7 @@ Name | Type | Description | Notes
[[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) [[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)
# **update_pet** # **update_pet**
> update_pet(body => $body) > update_pet(pet => $pet)
Update an existing pet Update an existing pet
@ -278,10 +278,10 @@ my $api_instance = WWW::OpenAPIClient::PetApi->new(
access_token => 'YOUR_ACCESS_TOKEN', access_token => 'YOUR_ACCESS_TOKEN',
); );
my $body = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store my $pet = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
eval { eval {
$api_instance->update_pet(body => $body); $api_instance->update_pet(pet => $pet);
}; };
if ($@) { if ($@) {
warn "Exception when calling PetApi->update_pet: $@\n"; warn "Exception when calling PetApi->update_pet: $@\n";
@ -292,7 +292,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type

View File

@ -154,7 +154,7 @@ No authorization required
[[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) [[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)
# **place_order** # **place_order**
> Order place_order(body => $body) > Order place_order(order => $order)
Place an order for a pet Place an order for a pet
@ -165,10 +165,10 @@ use WWW::OpenAPIClient::StoreApi;
my $api_instance = WWW::OpenAPIClient::StoreApi->new( my $api_instance = WWW::OpenAPIClient::StoreApi->new(
); );
my $body = WWW::OpenAPIClient::Object::Order->new(); # Order | order placed for purchasing the pet my $order = WWW::OpenAPIClient::Object::Order->new(); # Order | order placed for purchasing the pet
eval { eval {
my $result = $api_instance->place_order(body => $body); my $result = $api_instance->place_order(order => $order);
print Dumper($result); print Dumper($result);
}; };
if ($@) { if ($@) {
@ -180,7 +180,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet | **order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type ### Return type
@ -192,7 +192,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: application/xml, application/json - **Accept**: application/xml, application/json
[[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) [[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)

View File

@ -0,0 +1,19 @@
# WWW::OpenAPIClient::Object::TypeHolderDefault
## Load the model package
```perl
use WWW::OpenAPIClient::Object::TypeHolderDefault;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string_item** | **string** | | [default to 'what']
**number_item** | **double** | |
**integer_item** | **int** | |
**bool_item** | **boolean** | | [default to true]
**array_item** | **ARRAY[int]** | |
[[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

@ -0,0 +1,19 @@
# WWW::OpenAPIClient::Object::TypeHolderExample
## Load the model package
```perl
use WWW::OpenAPIClient::Object::TypeHolderExample;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string_item** | **string** | |
**number_item** | **double** | |
**integer_item** | **int** | |
**bool_item** | **boolean** | |
**array_item** | **ARRAY[int]** | |
[[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

@ -20,7 +20,7 @@ Method | HTTP request | Description
# **create_user** # **create_user**
> create_user(body => $body) > create_user(user => $user)
Create user Create user
@ -33,10 +33,10 @@ use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new( my $api_instance = WWW::OpenAPIClient::UserApi->new(
); );
my $body = WWW::OpenAPIClient::Object::User->new(); # User | Created user object my $user = WWW::OpenAPIClient::Object::User->new(); # User | Created user object
eval { eval {
$api_instance->create_user(body => $body); $api_instance->create_user(user => $user);
}; };
if ($@) { if ($@) {
warn "Exception when calling UserApi->create_user: $@\n"; warn "Exception when calling UserApi->create_user: $@\n";
@ -47,7 +47,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object | **user** | [**User**](User.md)| Created user object |
### Return type ### Return type
@ -59,13 +59,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined
[[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) [[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)
# **create_users_with_array_input** # **create_users_with_array_input**
> create_users_with_array_input(body => $body) > create_users_with_array_input(user => $user)
Creates list of users with given input array Creates list of users with given input array
@ -76,10 +76,10 @@ use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new( my $api_instance = WWW::OpenAPIClient::UserApi->new(
); );
my $body = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object my $user = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object
eval { eval {
$api_instance->create_users_with_array_input(body => $body); $api_instance->create_users_with_array_input(user => $user);
}; };
if ($@) { if ($@) {
warn "Exception when calling UserApi->create_users_with_array_input: $@\n"; warn "Exception when calling UserApi->create_users_with_array_input: $@\n";
@ -90,7 +90,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**ARRAY[User]**](ARRAY.md)| List of user object | **user** | [**ARRAY[User]**](ARRAY.md)| List of user object |
### Return type ### Return type
@ -102,13 +102,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined
[[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) [[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)
# **create_users_with_list_input** # **create_users_with_list_input**
> create_users_with_list_input(body => $body) > create_users_with_list_input(user => $user)
Creates list of users with given input array Creates list of users with given input array
@ -119,10 +119,10 @@ use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new( my $api_instance = WWW::OpenAPIClient::UserApi->new(
); );
my $body = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object my $user = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object
eval { eval {
$api_instance->create_users_with_list_input(body => $body); $api_instance->create_users_with_list_input(user => $user);
}; };
if ($@) { if ($@) {
warn "Exception when calling UserApi->create_users_with_list_input: $@\n"; warn "Exception when calling UserApi->create_users_with_list_input: $@\n";
@ -133,7 +133,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**ARRAY[User]**](ARRAY.md)| List of user object | **user** | [**ARRAY[User]**](ARRAY.md)| List of user object |
### Return type ### Return type
@ -145,7 +145,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined
[[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) [[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)
@ -325,7 +325,7 @@ No authorization required
[[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) [[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)
# **update_user** # **update_user**
> update_user(username => $username, body => $body) > update_user(username => $username, user => $user)
Updated user Updated user
@ -339,10 +339,10 @@ my $api_instance = WWW::OpenAPIClient::UserApi->new(
); );
my $username = "username_example"; # string | name that need to be deleted my $username = "username_example"; # string | name that need to be deleted
my $body = WWW::OpenAPIClient::Object::User->new(); # User | Updated user object my $user = WWW::OpenAPIClient::Object::User->new(); # User | Updated user object
eval { eval {
$api_instance->update_user(username => $username, body => $body); $api_instance->update_user(username => $username, user => $user);
}; };
if ($@) { if ($@) {
warn "Exception when calling UserApi->update_user: $@\n"; warn "Exception when calling UserApi->update_user: $@\n";
@ -354,7 +354,7 @@ if ($@) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **string**| name that need to be deleted | **username** | **string**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object | **user** | [**User**](User.md)| Updated user object |
### Return type ### Return type
@ -366,7 +366,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: Not defined - **Accept**: Not defined
[[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) [[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)

View File

@ -0,0 +1,43 @@
# WWW::OpenAPIClient::Object::XmlItem
## Load the model package
```perl
use WWW::OpenAPIClient::Object::XmlItem;
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attribute_string** | **string** | | [optional]
**attribute_number** | **double** | | [optional]
**attribute_integer** | **int** | | [optional]
**attribute_boolean** | **boolean** | | [optional]
**wrapped_array** | **ARRAY[int]** | | [optional]
**name_string** | **string** | | [optional]
**name_number** | **double** | | [optional]
**name_integer** | **int** | | [optional]
**name_boolean** | **boolean** | | [optional]
**name_array** | **ARRAY[int]** | | [optional]
**name_wrapped_array** | **ARRAY[int]** | | [optional]
**prefix_string** | **string** | | [optional]
**prefix_number** | **double** | | [optional]
**prefix_integer** | **int** | | [optional]
**prefix_boolean** | **boolean** | | [optional]
**prefix_array** | **ARRAY[int]** | | [optional]
**prefix_wrapped_array** | **ARRAY[int]** | | [optional]
**namespace_string** | **string** | | [optional]
**namespace_number** | **double** | | [optional]
**namespace_integer** | **int** | | [optional]
**namespace_boolean** | **boolean** | | [optional]
**namespace_array** | **ARRAY[int]** | | [optional]
**namespace_wrapped_array** | **ARRAY[int]** | | [optional]
**prefix_ns_string** | **string** | | [optional]
**prefix_ns_number** | **double** | | [optional]
**prefix_ns_integer** | **int** | | [optional]
**prefix_ns_boolean** | **boolean** | | [optional]
**prefix_ns_array** | **ARRAY[int]** | | [optional]
**prefix_ns_wrapped_array** | **ARRAY[int]** | | [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

@ -53,10 +53,10 @@ sub new {
# #
# To test special tags # To test special tags
# #
# @param Client $body client model (required) # @param Client $client client model (required)
{ {
my $params = { my $params = {
'body' => { 'client' => {
data_type => 'Client', data_type => 'Client',
description => 'client model', description => 'client model',
required => '1', required => '1',
@ -73,9 +73,9 @@ sub new {
sub call_123_test_special_tags { sub call_123_test_special_tags {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'client' is set
unless (exists $args{'body'}) { unless (exists $args{'client'}) {
croak("Missing the required parameter 'body' when calling call_123_test_special_tags"); croak("Missing the required parameter 'client' when calling call_123_test_special_tags");
} }
# parse inputs # parse inputs
@ -95,8 +95,8 @@ sub call_123_test_special_tags {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'client'}) {
$_body_data = $args{'body'}; $_body_data = $args{'client'};
} }
# authentication setting, if any # authentication setting, if any

View File

@ -348,6 +348,11 @@ sub update_params_for_auth {
$query_params->{'api_key_query'} = $api_key; $query_params->{'api_key_query'} = $api_key;
} }
} }
elsif ($auth eq 'bearer_test') {
if ($self->{config}{username} || $self->{config}{password}) {
$header_params->{'Authorization'} = 'Basic ' . encode_base64($self->{config}{username} . ":" . $self->{config}{password});
}
}
elsif ($auth eq 'http_basic_test') { elsif ($auth eq 'http_basic_test') {
if ($self->{config}{username} || $self->{config}{password}) { if ($self->{config}{username} || $self->{config}{password}) {
$header_params->{'Authorization'} = 'Basic ' . encode_base64($self->{config}{username} . ":" . $self->{config}{password}); $header_params->{'Authorization'} = 'Basic ' . encode_base64($self->{config}{username} . ":" . $self->{config}{password});

View File

@ -57,7 +57,7 @@ sub new {
my $params = { my $params = {
}; };
__PACKAGE__->method_documentation->{ 'foo_get' } = { __PACKAGE__->method_documentation->{ 'foo_get' } = {
summary => '', summary => '',
params => $params, params => $params,
returns => 'InlineResponseDefault', returns => 'InlineResponseDefault',
}; };

View File

@ -48,6 +48,55 @@ sub new {
} }
#
# fake_health_get
#
# Health check endpoint
#
{
my $params = {
};
__PACKAGE__->method_documentation->{ 'fake_health_get' } = {
summary => 'Health check endpoint',
params => $params,
returns => 'HealthCheckResult',
};
}
# @return HealthCheckResult
#
sub fake_health_get {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/fake/health';
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('application/json');
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('HealthCheckResult', $response);
return $_response_object;
}
# #
# fake_outer_boolean_serialize # fake_outer_boolean_serialize
# #
@ -86,7 +135,7 @@ sub fake_outer_boolean_serialize {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
@ -113,10 +162,10 @@ sub fake_outer_boolean_serialize {
# #
# #
# #
# @param OuterComposite $body Input composite as post body (optional) # @param OuterComposite $outer_composite Input composite as post body (optional)
{ {
my $params = { my $params = {
'body' => { 'outer_composite' => {
data_type => 'OuterComposite', data_type => 'OuterComposite',
description => 'Input composite as post body', description => 'Input composite as post body',
required => '0', required => '0',
@ -146,12 +195,12 @@ sub fake_outer_composite_serialize {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'outer_composite'}) {
$_body_data = $args{'body'}; $_body_data = $args{'outer_composite'};
} }
# authentication setting, if any # authentication setting, if any
@ -206,7 +255,7 @@ sub fake_outer_number_serialize {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
@ -266,7 +315,7 @@ sub fake_outer_string_serialize {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
@ -293,10 +342,10 @@ sub fake_outer_string_serialize {
# #
# #
# #
# @param FileSchemaTestClass $body (required) # @param FileSchemaTestClass $file_schema_test_class (required)
{ {
my $params = { my $params = {
'body' => { 'file_schema_test_class' => {
data_type => 'FileSchemaTestClass', data_type => 'FileSchemaTestClass',
description => '', description => '',
required => '1', required => '1',
@ -313,9 +362,9 @@ sub fake_outer_string_serialize {
sub test_body_with_file_schema { sub test_body_with_file_schema {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'file_schema_test_class' is set
unless (exists $args{'body'}) { unless (exists $args{'file_schema_test_class'}) {
croak("Missing the required parameter 'body' when calling test_body_with_file_schema"); croak("Missing the required parameter 'file_schema_test_class' when calling test_body_with_file_schema");
} }
# parse inputs # parse inputs
@ -335,8 +384,8 @@ sub test_body_with_file_schema {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'file_schema_test_class'}) {
$_body_data = $args{'body'}; $_body_data = $args{'file_schema_test_class'};
} }
# authentication setting, if any # authentication setting, if any
@ -355,7 +404,7 @@ sub test_body_with_file_schema {
# #
# #
# @param string $query (required) # @param string $query (required)
# @param User $body (required) # @param User $user (required)
{ {
my $params = { my $params = {
'query' => { 'query' => {
@ -363,7 +412,7 @@ sub test_body_with_file_schema {
description => '', description => '',
required => '1', required => '1',
}, },
'body' => { 'user' => {
data_type => 'User', data_type => 'User',
description => '', description => '',
required => '1', required => '1',
@ -385,9 +434,9 @@ sub test_body_with_query_params {
croak("Missing the required parameter 'query' when calling test_body_with_query_params"); croak("Missing the required parameter 'query' when calling test_body_with_query_params");
} }
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
unless (exists $args{'body'}) { unless (exists $args{'user'}) {
croak("Missing the required parameter 'body' when calling test_body_with_query_params"); croak("Missing the required parameter 'user' when calling test_body_with_query_params");
} }
# parse inputs # parse inputs
@ -412,8 +461,8 @@ sub test_body_with_query_params {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'user'}) {
$_body_data = $args{'body'}; $_body_data = $args{'user'};
} }
# authentication setting, if any # authentication setting, if any
@ -431,10 +480,10 @@ sub test_body_with_query_params {
# #
# To test \"client\" model # To test \"client\" model
# #
# @param Client $body client model (required) # @param Client $client client model (required)
{ {
my $params = { my $params = {
'body' => { 'client' => {
data_type => 'Client', data_type => 'Client',
description => 'client model', description => 'client model',
required => '1', required => '1',
@ -451,9 +500,9 @@ sub test_body_with_query_params {
sub test_client_model { sub test_client_model {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'client' is set
unless (exists $args{'body'}) { unless (exists $args{'client'}) {
croak("Missing the required parameter 'body' when calling test_client_model"); croak("Missing the required parameter 'client' when calling test_client_model");
} }
# parse inputs # parse inputs
@ -473,8 +522,8 @@ sub test_client_model {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'client'}) {
$_body_data = $args{'body'}; $_body_data = $args{'client'};
} }
# authentication setting, if any # authentication setting, if any
@ -961,7 +1010,7 @@ sub test_group_parameters {
my $_body_data; my $_body_data;
# authentication setting, if any # authentication setting, if any
my $auth_settings = [qw()]; my $auth_settings = [qw(bearer_test )];
# make the API Call # make the API Call
$self->{api_client}->call_api($_resource_path, $_method, $self->{api_client}->call_api($_resource_path, $_method,
@ -975,10 +1024,10 @@ sub test_group_parameters {
# #
# test inline additionalProperties # test inline additionalProperties
# #
# @param HASH[string,string] $param request body (required) # @param HASH[string,string] $request_body request body (required)
{ {
my $params = { my $params = {
'param' => { 'request_body' => {
data_type => 'HASH[string,string]', data_type => 'HASH[string,string]',
description => 'request body', description => 'request body',
required => '1', required => '1',
@ -995,9 +1044,9 @@ sub test_group_parameters {
sub test_inline_additional_properties { sub test_inline_additional_properties {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'param' is set # verify the required parameter 'request_body' is set
unless (exists $args{'param'}) { unless (exists $args{'request_body'}) {
croak("Missing the required parameter 'param' when calling test_inline_additional_properties"); croak("Missing the required parameter 'request_body' when calling test_inline_additional_properties");
} }
# parse inputs # parse inputs
@ -1017,8 +1066,8 @@ sub test_inline_additional_properties {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'param'}) { if ( exists $args{'request_body'}) {
$_body_data = $args{'param'}; $_body_data = $args{'request_body'};
} }
# authentication setting, if any # authentication setting, if any

View File

@ -53,10 +53,10 @@ sub new {
# #
# To test class name in snake case # To test class name in snake case
# #
# @param Client $body client model (required) # @param Client $client client model (required)
{ {
my $params = { my $params = {
'body' => { 'client' => {
data_type => 'Client', data_type => 'Client',
description => 'client model', description => 'client model',
required => '1', required => '1',
@ -73,9 +73,9 @@ sub new {
sub test_classname { sub test_classname {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'client' is set
unless (exists $args{'body'}) { unless (exists $args{'client'}) {
croak("Missing the required parameter 'body' when calling test_classname"); croak("Missing the required parameter 'client' when calling test_classname");
} }
# parse inputs # parse inputs
@ -95,8 +95,8 @@ sub test_classname {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'client'}) {
$_body_data = $args{'body'}; $_body_data = $args{'client'};
} }
# authentication setting, if any # authentication setting, if any

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesAnyType;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'AdditionalPropertiesAnyType',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'name' => {
datatype => 'string',
base_name => 'name',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'name' => 'string'
} );
__PACKAGE__->attribute_map( {
'name' => 'name'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesArray;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'AdditionalPropertiesArray',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'name' => {
datatype => 'string',
base_name => 'name',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'name' => 'string'
} );
__PACKAGE__->attribute_map( {
'name' => 'name'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesBoolean;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'AdditionalPropertiesBoolean',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'name' => {
datatype => 'string',
base_name => 'name',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'name' => 'string'
} );
__PACKAGE__->attribute_map( {
'name' => 'name'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesInteger;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'AdditionalPropertiesInteger',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'name' => {
datatype => 'string',
base_name => 'name',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'name' => 'string'
} );
__PACKAGE__->attribute_map( {
'name' => 'name'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesNumber;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'AdditionalPropertiesNumber',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'name' => {
datatype => 'string',
base_name => 'name',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'name' => 'string'
} );
__PACKAGE__->attribute_map( {
'name' => 'name'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesObject;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'AdditionalPropertiesObject',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'name' => {
datatype => 'string',
base_name => 'name',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'name' => 'string'
} );
__PACKAGE__->attribute_map( {
'name' => 'name'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesString;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'AdditionalPropertiesString',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'name' => {
datatype => 'string',
base_name => 'name',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'name' => 'string'
} );
__PACKAGE__->attribute_map( {
'name' => 'name'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -115,13 +115,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -124,13 +124,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -124,13 +124,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -31,6 +31,9 @@ use Date::Parse;
use DateTime; use DateTime;
use WWW::OpenAPIClient::Object::OuterEnum; use WWW::OpenAPIClient::Object::OuterEnum;
use WWW::OpenAPIClient::Object::OuterEnumDefaultValue;
use WWW::OpenAPIClient::Object::OuterEnumInteger;
use WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue;
use base ("Class::Accessor", "Class::Data::Inheritable"); use base ("Class::Accessor", "Class::Data::Inheritable");
@ -115,13 +118,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
@ -190,6 +200,27 @@ __PACKAGE__->method_documentation({
format => '', format => '',
read_only => '', read_only => '',
}, },
'outer_enum_integer' => {
datatype => 'OuterEnumInteger',
base_name => 'outerEnumInteger',
description => '',
format => '',
read_only => '',
},
'outer_enum_default_value' => {
datatype => 'OuterEnumDefaultValue',
base_name => 'outerEnumDefaultValue',
description => '',
format => '',
read_only => '',
},
'outer_enum_integer_default_value' => {
datatype => 'OuterEnumIntegerDefaultValue',
base_name => 'outerEnumIntegerDefaultValue',
description => '',
format => '',
read_only => '',
},
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {
@ -197,7 +228,10 @@ __PACKAGE__->openapi_types( {
'enum_string_required' => 'string', 'enum_string_required' => 'string',
'enum_integer' => 'int', 'enum_integer' => 'int',
'enum_number' => 'double', 'enum_number' => 'double',
'outer_enum' => 'OuterEnum' 'outer_enum' => 'OuterEnum',
'outer_enum_integer' => 'OuterEnumInteger',
'outer_enum_default_value' => 'OuterEnumDefaultValue',
'outer_enum_integer_default_value' => 'OuterEnumIntegerDefaultValue'
} ); } );
__PACKAGE__->attribute_map( { __PACKAGE__->attribute_map( {
@ -205,7 +239,10 @@ __PACKAGE__->attribute_map( {
'enum_string_required' => 'enum_string_required', 'enum_string_required' => 'enum_string_required',
'enum_integer' => 'enum_integer', 'enum_integer' => 'enum_integer',
'enum_number' => 'enum_number', 'enum_number' => 'enum_number',
'outer_enum' => 'outerEnum' 'outer_enum' => 'outerEnum',
'outer_enum_integer' => 'outerEnumInteger',
'outer_enum_default_value' => 'outerEnumDefaultValue',
'outer_enum_integer_default_value' => 'outerEnumIntegerDefaultValue'
} ); } );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -115,13 +115,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -68,11 +68,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -80,10 +80,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -113,18 +113,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -155,12 +162,12 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'bar' => { 'bar' => {
datatype => 'string', datatype => 'string',
base_name => 'bar', base_name => 'bar',
description => '', description => '',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
@ -245,6 +252,20 @@ __PACKAGE__->method_documentation({
format => '', format => '',
read_only => '', read_only => '',
}, },
'pattern_with_digits' => {
datatype => 'string',
base_name => 'pattern_with_digits',
description => 'A string that is a 10 digit number. Can have leading zeros.',
format => '',
read_only => '',
},
'pattern_with_digits_and_delimiter' => {
datatype => 'string',
base_name => 'pattern_with_digits_and_delimiter',
description => 'A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.',
format => '',
read_only => '',
},
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {
@ -260,7 +281,9 @@ __PACKAGE__->openapi_types( {
'date' => 'DateTime', 'date' => 'DateTime',
'date_time' => 'DateTime', 'date_time' => 'DateTime',
'uuid' => 'string', 'uuid' => 'string',
'password' => 'string' 'password' => 'string',
'pattern_with_digits' => 'string',
'pattern_with_digits_and_delimiter' => 'string'
} ); } );
__PACKAGE__->attribute_map( { __PACKAGE__->attribute_map( {
@ -276,7 +299,9 @@ __PACKAGE__->attribute_map( {
'date' => 'date', 'date' => 'date',
'date_time' => 'dateTime', 'date_time' => 'dateTime',
'uuid' => 'uuid', 'uuid' => 'uuid',
'password' => 'password' 'password' => 'password',
'pattern_with_digits' => 'pattern_with_digits',
'pattern_with_digits_and_delimiter' => 'pattern_with_digits_and_delimiter'
} ); } );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -0,0 +1,184 @@
=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: \" \\
OpenAPI spec version: 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::HealthCheckResult;
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");
#
#Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
#
# 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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => 'Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.',
class => 'HealthCheckResult',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'nullable_message' => {
datatype => 'string',
base_name => 'NullableMessage',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'nullable_message' => 'string'
} );
__PACKAGE__->attribute_map( {
'nullable_message' => 'NullableMessage'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -68,11 +68,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -80,10 +80,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -113,18 +113,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -155,19 +162,19 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'name' => { 'name' => {
datatype => 'string', datatype => 'string',
base_name => 'name', base_name => 'name',
description => 'Updated name of the pet', description => 'Updated name of the pet',
format => '', format => '',
read_only => '', read_only => '',
}, },
'status' => { 'status' => {
datatype => 'string', datatype => 'string',
base_name => 'status', base_name => 'status',
description => 'Updated status of the pet', description => 'Updated status of the pet',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -68,11 +68,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -80,10 +80,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -113,18 +113,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -155,19 +162,19 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'additional_metadata' => { 'additional_metadata' => {
datatype => 'string', datatype => 'string',
base_name => 'additionalMetadata', base_name => 'additionalMetadata',
description => 'Additional data to pass to server', description => 'Additional data to pass to server',
format => '', format => '',
read_only => '', read_only => '',
}, },
'file' => { 'file' => {
datatype => 'string', datatype => 'string',
base_name => 'file', base_name => 'file',
description => 'file to upload', description => 'file to upload',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -68,11 +68,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -80,10 +80,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -113,18 +113,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -155,19 +162,19 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'enum_form_string_array' => { 'enum_form_string_array' => {
datatype => 'ARRAY[string]', datatype => 'ARRAY[string]',
base_name => 'enum_form_string_array', base_name => 'enum_form_string_array',
description => 'Form parameter enum test (string array)', description => 'Form parameter enum test (string array)',
format => '', format => '',
read_only => '', read_only => '',
}, },
'enum_form_string' => { 'enum_form_string' => {
datatype => 'string', datatype => 'string',
base_name => 'enum_form_string', base_name => 'enum_form_string',
description => 'Form parameter enum test (string)', description => 'Form parameter enum test (string)',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -68,11 +68,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -80,10 +80,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -113,18 +113,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -155,103 +162,103 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'integer' => { 'integer' => {
datatype => 'int', datatype => 'int',
base_name => 'integer', base_name => 'integer',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'int32' => { 'int32' => {
datatype => 'int', datatype => 'int',
base_name => 'int32', base_name => 'int32',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'int64' => { 'int64' => {
datatype => 'int', datatype => 'int',
base_name => 'int64', base_name => 'int64',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'number' => { 'number' => {
datatype => 'double', datatype => 'double',
base_name => 'number', base_name => 'number',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'float' => { 'float' => {
datatype => 'double', datatype => 'double',
base_name => 'float', base_name => 'float',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'double' => { 'double' => {
datatype => 'double', datatype => 'double',
base_name => 'double', base_name => 'double',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'string' => { 'string' => {
datatype => 'string', datatype => 'string',
base_name => 'string', base_name => 'string',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'pattern_without_delimiter' => { 'pattern_without_delimiter' => {
datatype => 'string', datatype => 'string',
base_name => 'pattern_without_delimiter', base_name => 'pattern_without_delimiter',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'byte' => { 'byte' => {
datatype => 'string', datatype => 'string',
base_name => 'byte', base_name => 'byte',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'binary' => { 'binary' => {
datatype => 'string', datatype => 'string',
base_name => 'binary', base_name => 'binary',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'date' => { 'date' => {
datatype => 'DateTime', datatype => 'DateTime',
base_name => 'date', base_name => 'date',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'date_time' => { 'date_time' => {
datatype => 'DateTime', datatype => 'DateTime',
base_name => 'dateTime', base_name => 'dateTime',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'password' => { 'password' => {
datatype => 'string', datatype => 'string',
base_name => 'password', base_name => 'password',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
'callback' => { 'callback' => {
datatype => 'string', datatype => 'string',
base_name => 'callback', base_name => 'callback',
description => 'None', description => 'None',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -68,11 +68,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -80,10 +80,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -113,18 +113,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -155,19 +162,19 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'param' => { 'param' => {
datatype => 'string', datatype => 'string',
base_name => 'param', base_name => 'param',
description => 'field1', description => 'field1',
format => '', format => '',
read_only => '', read_only => '',
}, },
'param2' => { 'param2' => {
datatype => 'string', datatype => 'string',
base_name => 'param2', base_name => 'param2',
description => 'field2', description => 'field2',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -68,11 +68,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -80,10 +80,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -113,18 +113,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -155,19 +162,19 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'additional_metadata' => { 'additional_metadata' => {
datatype => 'string', datatype => 'string',
base_name => 'additionalMetadata', base_name => 'additionalMetadata',
description => 'Additional data to pass to server', description => 'Additional data to pass to server',
format => '', format => '',
read_only => '', read_only => '',
}, },
'required_file' => { 'required_file' => {
datatype => 'string', datatype => 'string',
base_name => 'requiredFile', base_name => 'requiredFile',
description => 'file to upload', description => 'file to upload',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -69,11 +69,11 @@ __PACKAGE__->mk_classdata('class_documentation' => {});
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
my $self = bless {}, $class; my $self = bless {}, $class;
$self->init(%args); $self->init(%args);
return $self; return $self;
} }
# initialize the object # initialize the object
@ -81,10 +81,10 @@ sub init
{ {
my ($self, %args) = @_; my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) { foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute}; my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } ); $self->$attribute( $args{ $args_key } );
} }
} }
# return perl hash # return perl hash
@ -114,18 +114,25 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
} }
} }
@ -156,12 +163,12 @@ __PACKAGE__->class_documentation({description => '',
__PACKAGE__->method_documentation({ __PACKAGE__->method_documentation({
'string' => { 'string' => {
datatype => 'Foo', datatype => 'Foo',
base_name => 'string', base_name => 'string',
description => '', description => '',
format => '', format => '',
read_only => '', read_only => '',
}, },
}); });
__PACKAGE__->openapi_types( { __PACKAGE__->openapi_types( {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -115,13 +115,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -0,0 +1,283 @@
=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: \" \\
OpenAPI spec version: 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::NullableClass;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'NullableClass',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'integer_prop' => {
datatype => 'int',
base_name => 'integer_prop',
description => '',
format => '',
read_only => '',
},
'number_prop' => {
datatype => 'double',
base_name => 'number_prop',
description => '',
format => '',
read_only => '',
},
'boolean_prop' => {
datatype => 'boolean',
base_name => 'boolean_prop',
description => '',
format => '',
read_only => '',
},
'string_prop' => {
datatype => 'string',
base_name => 'string_prop',
description => '',
format => '',
read_only => '',
},
'date_prop' => {
datatype => 'DateTime',
base_name => 'date_prop',
description => '',
format => '',
read_only => '',
},
'datetime_prop' => {
datatype => 'DateTime',
base_name => 'datetime_prop',
description => '',
format => '',
read_only => '',
},
'array_nullable_prop' => {
datatype => 'ARRAY[object]',
base_name => 'array_nullable_prop',
description => '',
format => '',
read_only => '',
},
'array_and_items_nullable_prop' => {
datatype => 'ARRAY[object]',
base_name => 'array_and_items_nullable_prop',
description => '',
format => '',
read_only => '',
},
'array_items_nullable' => {
datatype => 'ARRAY[object]',
base_name => 'array_items_nullable',
description => '',
format => '',
read_only => '',
},
'object_nullable_prop' => {
datatype => 'HASH[string,object]',
base_name => 'object_nullable_prop',
description => '',
format => '',
read_only => '',
},
'object_and_items_nullable_prop' => {
datatype => 'HASH[string,object]',
base_name => 'object_and_items_nullable_prop',
description => '',
format => '',
read_only => '',
},
'object_items_nullable' => {
datatype => 'HASH[string,object]',
base_name => 'object_items_nullable',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'integer_prop' => 'int',
'number_prop' => 'double',
'boolean_prop' => 'boolean',
'string_prop' => 'string',
'date_prop' => 'DateTime',
'datetime_prop' => 'DateTime',
'array_nullable_prop' => 'ARRAY[object]',
'array_and_items_nullable_prop' => 'ARRAY[object]',
'array_items_nullable' => 'ARRAY[object]',
'object_nullable_prop' => 'HASH[string,object]',
'object_and_items_nullable_prop' => 'HASH[string,object]',
'object_items_nullable' => 'HASH[string,object]'
} );
__PACKAGE__->attribute_map( {
'integer_prop' => 'integer_prop',
'number_prop' => 'number_prop',
'boolean_prop' => 'boolean_prop',
'string_prop' => 'string_prop',
'date_prop' => 'date_prop',
'datetime_prop' => 'datetime_prop',
'array_nullable_prop' => 'array_nullable_prop',
'array_and_items_nullable_prop' => 'array_and_items_nullable_prop',
'array_items_nullable' => 'array_items_nullable',
'object_nullable_prop' => 'object_nullable_prop',
'object_and_items_nullable_prop' => 'object_and_items_nullable_prop',
'object_items_nullable' => 'object_items_nullable'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::OuterEnumDefaultValue;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'OuterEnumDefaultValue',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
});
__PACKAGE__->openapi_types( {
} );
__PACKAGE__->attribute_map( {
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::OuterEnumInteger;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'OuterEnumInteger',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
});
__PACKAGE__->openapi_types( {
} );
__PACKAGE__->attribute_map( {
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,177 @@
=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: \" \\
OpenAPI spec version: 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::OuterEnumIntegerDefaultValue;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'OuterEnumIntegerDefaultValue',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
});
__PACKAGE__->openapi_types( {
} );
__PACKAGE__->attribute_map( {
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -116,13 +116,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -0,0 +1,213 @@
=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: \" \\
OpenAPI spec version: 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::TypeHolderDefault;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'TypeHolderDefault',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'string_item' => {
datatype => 'string',
base_name => 'string_item',
description => '',
format => '',
read_only => '',
},
'number_item' => {
datatype => 'double',
base_name => 'number_item',
description => '',
format => '',
read_only => '',
},
'integer_item' => {
datatype => 'int',
base_name => 'integer_item',
description => '',
format => '',
read_only => '',
},
'bool_item' => {
datatype => 'boolean',
base_name => 'bool_item',
description => '',
format => '',
read_only => '',
},
'array_item' => {
datatype => 'ARRAY[int]',
base_name => 'array_item',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'string_item' => 'string',
'number_item' => 'double',
'integer_item' => 'int',
'bool_item' => 'boolean',
'array_item' => 'ARRAY[int]'
} );
__PACKAGE__->attribute_map( {
'string_item' => 'string_item',
'number_item' => 'number_item',
'integer_item' => 'integer_item',
'bool_item' => 'bool_item',
'array_item' => 'array_item'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -0,0 +1,213 @@
=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: \" \\
OpenAPI spec version: 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::TypeHolderExample;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'TypeHolderExample',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'string_item' => {
datatype => 'string',
base_name => 'string_item',
description => '',
format => '',
read_only => '',
},
'number_item' => {
datatype => 'double',
base_name => 'number_item',
description => '',
format => '',
read_only => '',
},
'integer_item' => {
datatype => 'int',
base_name => 'integer_item',
description => '',
format => '',
read_only => '',
},
'bool_item' => {
datatype => 'boolean',
base_name => 'bool_item',
description => '',
format => '',
read_only => '',
},
'array_item' => {
datatype => 'ARRAY[int]',
base_name => 'array_item',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'string_item' => 'string',
'number_item' => 'double',
'integer_item' => 'int',
'bool_item' => 'boolean',
'array_item' => 'ARRAY[int]'
} );
__PACKAGE__->attribute_map( {
'string_item' => 'string_item',
'number_item' => 'number_item',
'integer_item' => 'integer_item',
'bool_item' => 'bool_item',
'array_item' => 'array_item'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -114,13 +114,20 @@ sub from_hash {
# loop through attributes and use openapi_types to deserialize the data # loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) { while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key}; my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = substr($_type, 6, -1); my $_subclass = $1;
my @_array = (); my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) { foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element); push @_array, $self->_deserialize($_subclass, $_element);
} }
$self->{$_key} = \@_array; $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 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else { } else {

View File

@ -0,0 +1,429 @@
=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: \" \\
OpenAPI spec version: 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::XmlItem;
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: \" \\
OpenAPI spec version: 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}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
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 = substr($_type, 6, -1);
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} 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 ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep {$type=~/^(ARRAY\[|HASH\[string,)?$_(\])?$/} ('int', 'double', 'string', 'boolean') ) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'XmlItem',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'attribute_string' => {
datatype => 'string',
base_name => 'attribute_string',
description => '',
format => '',
read_only => '',
},
'attribute_number' => {
datatype => 'double',
base_name => 'attribute_number',
description => '',
format => '',
read_only => '',
},
'attribute_integer' => {
datatype => 'int',
base_name => 'attribute_integer',
description => '',
format => '',
read_only => '',
},
'attribute_boolean' => {
datatype => 'boolean',
base_name => 'attribute_boolean',
description => '',
format => '',
read_only => '',
},
'wrapped_array' => {
datatype => 'ARRAY[int]',
base_name => 'wrapped_array',
description => '',
format => '',
read_only => '',
},
'name_string' => {
datatype => 'string',
base_name => 'name_string',
description => '',
format => '',
read_only => '',
},
'name_number' => {
datatype => 'double',
base_name => 'name_number',
description => '',
format => '',
read_only => '',
},
'name_integer' => {
datatype => 'int',
base_name => 'name_integer',
description => '',
format => '',
read_only => '',
},
'name_boolean' => {
datatype => 'boolean',
base_name => 'name_boolean',
description => '',
format => '',
read_only => '',
},
'name_array' => {
datatype => 'ARRAY[int]',
base_name => 'name_array',
description => '',
format => '',
read_only => '',
},
'name_wrapped_array' => {
datatype => 'ARRAY[int]',
base_name => 'name_wrapped_array',
description => '',
format => '',
read_only => '',
},
'prefix_string' => {
datatype => 'string',
base_name => 'prefix_string',
description => '',
format => '',
read_only => '',
},
'prefix_number' => {
datatype => 'double',
base_name => 'prefix_number',
description => '',
format => '',
read_only => '',
},
'prefix_integer' => {
datatype => 'int',
base_name => 'prefix_integer',
description => '',
format => '',
read_only => '',
},
'prefix_boolean' => {
datatype => 'boolean',
base_name => 'prefix_boolean',
description => '',
format => '',
read_only => '',
},
'prefix_array' => {
datatype => 'ARRAY[int]',
base_name => 'prefix_array',
description => '',
format => '',
read_only => '',
},
'prefix_wrapped_array' => {
datatype => 'ARRAY[int]',
base_name => 'prefix_wrapped_array',
description => '',
format => '',
read_only => '',
},
'namespace_string' => {
datatype => 'string',
base_name => 'namespace_string',
description => '',
format => '',
read_only => '',
},
'namespace_number' => {
datatype => 'double',
base_name => 'namespace_number',
description => '',
format => '',
read_only => '',
},
'namespace_integer' => {
datatype => 'int',
base_name => 'namespace_integer',
description => '',
format => '',
read_only => '',
},
'namespace_boolean' => {
datatype => 'boolean',
base_name => 'namespace_boolean',
description => '',
format => '',
read_only => '',
},
'namespace_array' => {
datatype => 'ARRAY[int]',
base_name => 'namespace_array',
description => '',
format => '',
read_only => '',
},
'namespace_wrapped_array' => {
datatype => 'ARRAY[int]',
base_name => 'namespace_wrapped_array',
description => '',
format => '',
read_only => '',
},
'prefix_ns_string' => {
datatype => 'string',
base_name => 'prefix_ns_string',
description => '',
format => '',
read_only => '',
},
'prefix_ns_number' => {
datatype => 'double',
base_name => 'prefix_ns_number',
description => '',
format => '',
read_only => '',
},
'prefix_ns_integer' => {
datatype => 'int',
base_name => 'prefix_ns_integer',
description => '',
format => '',
read_only => '',
},
'prefix_ns_boolean' => {
datatype => 'boolean',
base_name => 'prefix_ns_boolean',
description => '',
format => '',
read_only => '',
},
'prefix_ns_array' => {
datatype => 'ARRAY[int]',
base_name => 'prefix_ns_array',
description => '',
format => '',
read_only => '',
},
'prefix_ns_wrapped_array' => {
datatype => 'ARRAY[int]',
base_name => 'prefix_ns_wrapped_array',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'attribute_string' => 'string',
'attribute_number' => 'double',
'attribute_integer' => 'int',
'attribute_boolean' => 'boolean',
'wrapped_array' => 'ARRAY[int]',
'name_string' => 'string',
'name_number' => 'double',
'name_integer' => 'int',
'name_boolean' => 'boolean',
'name_array' => 'ARRAY[int]',
'name_wrapped_array' => 'ARRAY[int]',
'prefix_string' => 'string',
'prefix_number' => 'double',
'prefix_integer' => 'int',
'prefix_boolean' => 'boolean',
'prefix_array' => 'ARRAY[int]',
'prefix_wrapped_array' => 'ARRAY[int]',
'namespace_string' => 'string',
'namespace_number' => 'double',
'namespace_integer' => 'int',
'namespace_boolean' => 'boolean',
'namespace_array' => 'ARRAY[int]',
'namespace_wrapped_array' => 'ARRAY[int]',
'prefix_ns_string' => 'string',
'prefix_ns_number' => 'double',
'prefix_ns_integer' => 'int',
'prefix_ns_boolean' => 'boolean',
'prefix_ns_array' => 'ARRAY[int]',
'prefix_ns_wrapped_array' => 'ARRAY[int]'
} );
__PACKAGE__->attribute_map( {
'attribute_string' => 'attribute_string',
'attribute_number' => 'attribute_number',
'attribute_integer' => 'attribute_integer',
'attribute_boolean' => 'attribute_boolean',
'wrapped_array' => 'wrapped_array',
'name_string' => 'name_string',
'name_number' => 'name_number',
'name_integer' => 'name_integer',
'name_boolean' => 'name_boolean',
'name_array' => 'name_array',
'name_wrapped_array' => 'name_wrapped_array',
'prefix_string' => 'prefix_string',
'prefix_number' => 'prefix_number',
'prefix_integer' => 'prefix_integer',
'prefix_boolean' => 'prefix_boolean',
'prefix_array' => 'prefix_array',
'prefix_wrapped_array' => 'prefix_wrapped_array',
'namespace_string' => 'namespace_string',
'namespace_number' => 'namespace_number',
'namespace_integer' => 'namespace_integer',
'namespace_boolean' => 'namespace_boolean',
'namespace_array' => 'namespace_array',
'namespace_wrapped_array' => 'namespace_wrapped_array',
'prefix_ns_string' => 'prefix_ns_string',
'prefix_ns_number' => 'prefix_ns_number',
'prefix_ns_integer' => 'prefix_ns_integer',
'prefix_ns_boolean' => 'prefix_ns_boolean',
'prefix_ns_array' => 'prefix_ns_array',
'prefix_ns_wrapped_array' => 'prefix_ns_wrapped_array'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;

View File

@ -53,10 +53,10 @@ sub new {
# #
# Add a new pet to the store # Add a new pet to the store
# #
# @param Pet $body Pet object that needs to be added to the store (required) # @param Pet $pet Pet object that needs to be added to the store (required)
{ {
my $params = { my $params = {
'body' => { 'pet' => {
data_type => 'Pet', data_type => 'Pet',
description => 'Pet object that needs to be added to the store', description => 'Pet object that needs to be added to the store',
required => '1', required => '1',
@ -73,9 +73,9 @@ sub new {
sub add_pet { sub add_pet {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'pet' is set
unless (exists $args{'body'}) { unless (exists $args{'pet'}) {
croak("Missing the required parameter 'body' when calling add_pet"); croak("Missing the required parameter 'pet' when calling add_pet");
} }
# parse inputs # parse inputs
@ -95,8 +95,8 @@ sub add_pet {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'pet'}) {
$_body_data = $args{'body'}; $_body_data = $args{'pet'};
} }
# authentication setting, if any # authentication setting, if any
@ -385,10 +385,10 @@ sub get_pet_by_id {
# #
# Update an existing pet # Update an existing pet
# #
# @param Pet $body Pet object that needs to be added to the store (required) # @param Pet $pet Pet object that needs to be added to the store (required)
{ {
my $params = { my $params = {
'body' => { 'pet' => {
data_type => 'Pet', data_type => 'Pet',
description => 'Pet object that needs to be added to the store', description => 'Pet object that needs to be added to the store',
required => '1', required => '1',
@ -405,9 +405,9 @@ sub get_pet_by_id {
sub update_pet { sub update_pet {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'pet' is set
unless (exists $args{'body'}) { unless (exists $args{'pet'}) {
croak("Missing the required parameter 'body' when calling update_pet"); croak("Missing the required parameter 'pet' when calling update_pet");
} }
# parse inputs # parse inputs
@ -427,8 +427,8 @@ sub update_pet {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'pet'}) {
$_body_data = $args{'body'}; $_body_data = $args{'pet'};
} }
# authentication setting, if any # authentication setting, if any

View File

@ -232,10 +232,10 @@ sub get_order_by_id {
# #
# Place an order for a pet # Place an order for a pet
# #
# @param Order $body order placed for purchasing the pet (required) # @param Order $order order placed for purchasing the pet (required)
{ {
my $params = { my $params = {
'body' => { 'order' => {
data_type => 'Order', data_type => 'Order',
description => 'order placed for purchasing the pet', description => 'order placed for purchasing the pet',
required => '1', required => '1',
@ -252,9 +252,9 @@ sub get_order_by_id {
sub place_order { sub place_order {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'order' is set
unless (exists $args{'body'}) { unless (exists $args{'order'}) {
croak("Missing the required parameter 'body' when calling place_order"); croak("Missing the required parameter 'order' when calling place_order");
} }
# parse inputs # parse inputs
@ -270,12 +270,12 @@ sub place_order {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'order'}) {
$_body_data = $args{'body'}; $_body_data = $args{'order'};
} }
# authentication setting, if any # authentication setting, if any

View File

@ -53,10 +53,10 @@ sub new {
# #
# Create user # Create user
# #
# @param User $body Created user object (required) # @param User $user Created user object (required)
{ {
my $params = { my $params = {
'body' => { 'user' => {
data_type => 'User', data_type => 'User',
description => 'Created user object', description => 'Created user object',
required => '1', required => '1',
@ -73,9 +73,9 @@ sub new {
sub create_user { sub create_user {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
unless (exists $args{'body'}) { unless (exists $args{'user'}) {
croak("Missing the required parameter 'body' when calling create_user"); croak("Missing the required parameter 'user' when calling create_user");
} }
# parse inputs # parse inputs
@ -91,12 +91,12 @@ sub create_user {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'user'}) {
$_body_data = $args{'body'}; $_body_data = $args{'user'};
} }
# authentication setting, if any # authentication setting, if any
@ -114,10 +114,10 @@ sub create_user {
# #
# Creates list of users with given input array # Creates list of users with given input array
# #
# @param ARRAY[User] $body List of user object (required) # @param ARRAY[User] $user List of user object (required)
{ {
my $params = { my $params = {
'body' => { 'user' => {
data_type => 'ARRAY[User]', data_type => 'ARRAY[User]',
description => 'List of user object', description => 'List of user object',
required => '1', required => '1',
@ -134,9 +134,9 @@ sub create_user {
sub create_users_with_array_input { sub create_users_with_array_input {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
unless (exists $args{'body'}) { unless (exists $args{'user'}) {
croak("Missing the required parameter 'body' when calling create_users_with_array_input"); croak("Missing the required parameter 'user' when calling create_users_with_array_input");
} }
# parse inputs # parse inputs
@ -152,12 +152,12 @@ sub create_users_with_array_input {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'user'}) {
$_body_data = $args{'body'}; $_body_data = $args{'user'};
} }
# authentication setting, if any # authentication setting, if any
@ -175,10 +175,10 @@ sub create_users_with_array_input {
# #
# Creates list of users with given input array # Creates list of users with given input array
# #
# @param ARRAY[User] $body List of user object (required) # @param ARRAY[User] $user List of user object (required)
{ {
my $params = { my $params = {
'body' => { 'user' => {
data_type => 'ARRAY[User]', data_type => 'ARRAY[User]',
description => 'List of user object', description => 'List of user object',
required => '1', required => '1',
@ -195,9 +195,9 @@ sub create_users_with_array_input {
sub create_users_with_list_input { sub create_users_with_list_input {
my ($self, %args) = @_; my ($self, %args) = @_;
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
unless (exists $args{'body'}) { unless (exists $args{'user'}) {
croak("Missing the required parameter 'body' when calling create_users_with_list_input"); croak("Missing the required parameter 'user' when calling create_users_with_list_input");
} }
# parse inputs # parse inputs
@ -213,12 +213,12 @@ sub create_users_with_list_input {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'user'}) {
$_body_data = $args{'body'}; $_body_data = $args{'user'};
} }
# authentication setting, if any # authentication setting, if any
@ -493,7 +493,7 @@ sub logout_user {
# Updated user # Updated user
# #
# @param string $username name that need to be deleted (required) # @param string $username name that need to be deleted (required)
# @param User $body Updated user object (required) # @param User $user Updated user object (required)
{ {
my $params = { my $params = {
'username' => { 'username' => {
@ -501,7 +501,7 @@ sub logout_user {
description => 'name that need to be deleted', description => 'name that need to be deleted',
required => '1', required => '1',
}, },
'body' => { 'user' => {
data_type => 'User', data_type => 'User',
description => 'Updated user object', description => 'Updated user object',
required => '1', required => '1',
@ -523,9 +523,9 @@ sub update_user {
croak("Missing the required parameter 'username' when calling update_user"); croak("Missing the required parameter 'username' when calling update_user");
} }
# verify the required parameter 'body' is set # verify the required parameter 'user' is set
unless (exists $args{'body'}) { unless (exists $args{'user'}) {
croak("Missing the required parameter 'body' when calling update_user"); croak("Missing the required parameter 'user' when calling update_user");
} }
# parse inputs # parse inputs
@ -541,7 +541,7 @@ sub update_user {
if ($_header_accept) { if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept; $header_params->{'Accept'} = $_header_accept;
} }
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
# path params # path params
if ( exists $args{'username'}) { if ( exists $args{'username'}) {
@ -552,8 +552,8 @@ sub update_user {
my $_body_data; my $_body_data;
# body params # body params
if ( exists $args{'body'}) { if ( exists $args{'user'}) {
$_body_data = $args{'body'}; $_body_data = $args{'user'};
} }
# authentication setting, if any # authentication setting, if any

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesAnyType');
my $instance = WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesArray');
my $instance = WWW::OpenAPIClient::Object::AdditionalPropertiesArray->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::AdditionalPropertiesArray');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesBoolean');
my $instance = WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesInteger');
my $instance = WWW::OpenAPIClient::Object::AdditionalPropertiesInteger->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::AdditionalPropertiesInteger');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesNumber');
my $instance = WWW::OpenAPIClient::Object::AdditionalPropertiesNumber->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::AdditionalPropertiesNumber');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesObject');
my $instance = WWW::OpenAPIClient::Object::AdditionalPropertiesObject->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::AdditionalPropertiesObject');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::AdditionalPropertiesString');
my $instance = WWW::OpenAPIClient::Object::AdditionalPropertiesString->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::AdditionalPropertiesString');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::HealthCheckResult');
my $instance = WWW::OpenAPIClient::Object::HealthCheckResult->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::HealthCheckResult');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::NullableClass');
my $instance = WWW::OpenAPIClient::Object::NullableClass->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::NullableClass');

View File

@ -0,0 +1,33 @@
=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: \" \\
OpenAPI spec version: 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::OuterEnumDefaultValue');
my $instance = WWW::OpenAPIClient::Object::OuterEnumDefaultValue->new();
isa_ok($instance, 'WWW::OpenAPIClient::Object::OuterEnumDefaultValue');

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