Arne Jørgensen d5b3cc0534 [PHP] Fix date format serialization (#5754)
* [PHP] Honor Swagger/OpenAPI 'date' format

Per spec
(https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types),
DateTime instances defined as 'date' datatype need to be serialized as
defined by full-date - RFC3339, which has the format:

full-date       = date-fullyear "-" date-month "-" date-mday

ref:
https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14

see #5531
fixes #5607

* [PHP] Add `date` and `date-time` serializer tests

See #5531
See #5607

* [PHP] Improve codestyle of generated code

* [PHP] Regenerate PHP Petstore sample

* [PHP] Regenerate PHP Security sample
2017-06-05 00:47:56 +08:00
..
2016-09-06 14:45:04 +03:00
2016-06-28 11:48:52 +08:00

SwaggerClient-php

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \ *_/ ' " =end --

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0 *_/ ' " =end -- \r\n \n \r
  • Build package: io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.4.0 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\FakeApi();
$test_code_inject____end____rn_n_r = "test_code_inject____end____rn_n_r_example"; // string | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r

try {
    $api_instance->testCodeInjectEndRnNR($test_code_inject____end____rn_n_r);
} catch (Exception $e) {
    echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to *https://petstore.swagger.io / ' &quot; =end -- \r\n \n \r/v2 */ ' &quot; =end -- \r\n \n \r

Class Method HTTP request Description
FakeApi testCodeInjectEndRnNR PUT /fake To test code injection *_/ ' &quot; =end -- \r\n \n \r

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key
  • API key parameter name: api_key */ ' " =end -- \r\n \n \r
  • Location: HTTP header

petstore_auth

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: http://petstore.swagger.io/api/oauth/dialog
  • Scopes:
  • write:pets: modify pets in your account *_/ ' " =end -- \r\n \n \r
  • read:pets: read your pets *_/ ' " =end -- \r\n \n \r

Author

apiteam@swagger.io *_/ ' &quot; =end -- \r\n \n \r