Skip to content

Commit f624519

Browse files
committed
adding samples
1 parent e04e582 commit f624519

92 files changed

Lines changed: 1678 additions & 360 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ public function __construct(?array $data = null)
265265
*/
266266
private function setIfExists(string $variableName, array $fields, $defaultValue): void
267267
{
268-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
269-
$this->openAPINullablesSetToNull[] = $variableName;
268+
$apivar = $this->attributeMap()[$variableName];
269+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
270+
$this->openAPINullablesSetToNull[] = $apivar;
270271
}
271-
272-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
272+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
273273
}
274274

275275
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ public function __construct(?array $data = null)
265265
*/
266266
private function setIfExists(string $variableName, array $fields, $defaultValue): void
267267
{
268-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
269-
$this->openAPINullablesSetToNull[] = $variableName;
268+
$apivar = $this->attributeMap()[$variableName];
269+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
270+
$this->openAPINullablesSetToNull[] = $apivar;
270271
}
271-
272-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
272+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
273273
}
274274

275275
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ public function __construct(?array $data = null)
268268
*/
269269
private function setIfExists(string $variableName, array $fields, $defaultValue): void
270270
{
271-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
272-
$this->openAPINullablesSetToNull[] = $variableName;
271+
$apivar = $this->attributeMap()[$variableName];
272+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
273+
$this->openAPINullablesSetToNull[] = $apivar;
273274
}
274-
275-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
275+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
276276
}
277277

278278
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ public function __construct(?array $data = null)
272272
*/
273273
private function setIfExists(string $variableName, array $fields, $defaultValue): void
274274
{
275-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
276-
$this->openAPINullablesSetToNull[] = $variableName;
275+
$apivar = $this->attributeMap()[$variableName];
276+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
277+
$this->openAPINullablesSetToNull[] = $apivar;
277278
}
278-
279-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
279+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
280280
}
281281

282282
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ public function __construct(?array $data = null)
258258
*/
259259
private function setIfExists(string $variableName, array $fields, $defaultValue): void
260260
{
261-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
262-
$this->openAPINullablesSetToNull[] = $variableName;
261+
$apivar = $this->attributeMap()[$variableName];
262+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
263+
$this->openAPINullablesSetToNull[] = $apivar;
263264
}
264-
265-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
265+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
266266
}
267267

268268
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ public function __construct(?array $data = null)
258258
*/
259259
private function setIfExists(string $variableName, array $fields, $defaultValue): void
260260
{
261-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
262-
$this->openAPINullablesSetToNull[] = $variableName;
261+
$apivar = $this->attributeMap()[$variableName];
262+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
263+
$this->openAPINullablesSetToNull[] = $apivar;
263264
}
264-
265-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
265+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
266266
}
267267

268268
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ public function __construct(?array $data = null)
272272
*/
273273
private function setIfExists(string $variableName, array $fields, $defaultValue): void
274274
{
275-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
276-
$this->openAPINullablesSetToNull[] = $variableName;
275+
$apivar = $this->attributeMap()[$variableName];
276+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
277+
$this->openAPINullablesSetToNull[] = $apivar;
277278
}
278-
279-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
279+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
280280
}
281281

282282
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,11 @@ public function __construct(?array $data = null)
293293
*/
294294
private function setIfExists(string $variableName, array $fields, $defaultValue): void
295295
{
296-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
297-
$this->openAPINullablesSetToNull[] = $variableName;
296+
$apivar = $this->attributeMap()[$variableName];
297+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
298+
$this->openAPINullablesSetToNull[] = $apivar;
298299
}
299-
300-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
300+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
301301
}
302302

303303
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ public function __construct(?array $data = null)
252252
*/
253253
private function setIfExists(string $variableName, array $fields, $defaultValue): void
254254
{
255-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
256-
$this->openAPINullablesSetToNull[] = $variableName;
255+
$apivar = $this->attributeMap()[$variableName];
256+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
257+
$this->openAPINullablesSetToNull[] = $apivar;
257258
}
258-
259-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
259+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
260260
}
261261

262262
/**

samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ public function __construct(?array $data = null)
265265
*/
266266
private function setIfExists(string $variableName, array $fields, $defaultValue): void
267267
{
268-
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
269-
$this->openAPINullablesSetToNull[] = $variableName;
268+
$apivar = $this->attributeMap()[$variableName];
269+
if (self::isNullable($variableName) && array_key_exists($apivar, $fields) && is_null($fields[$apivar])) {
270+
$this->openAPINullablesSetToNull[] = $apivar;
270271
}
271-
272-
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
272+
$this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
273273
}
274274

275275
/**

0 commit comments

Comments
 (0)