2017 © Pedro Peláez
 

library swagger-objects

PHP Object to Swagger Definitions

image

giansalex/swagger-objects

PHP Object to Swagger Definitions

  • Friday, February 2, 2018
  • by giansalex
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

PHP Object to SWAGGER

Travis-CI, (*1)

PHP Objects to Swagger Definitions., (*2)

Install

Via Composer from packagist.org., (*3)

composer require giansalex/swagger-objects

Php object

class Document
{
    /**
     * @var string
     */
    private $tipoDoc;

    /**
     * @var string
     */
    private $nroDoc;

    /**
     * @return string
     */
    public function getTipoDoc()
    {
        return $this->tipoDoc;
    }

    /**
     * @param string $tipoDoc
     * @return Document
     */
    public function setTipoDoc($tipoDoc)
    {
        $this->tipoDoc = $tipoDoc;
        return $this;
    }

    /**
     * @return string
     */
    public function getNroDoc()
    {
        return $this->nroDoc;
    }

    /**
     * @param string $nroDoc
     * @return Document
     */
    public function setNroDoc($nroDoc)
    {
        $this->nroDoc = $nroDoc;
        return $this;
    }
}

Usage

$swagger = new Swagger();
$result = $swagger->fromClass(Document::class);

var_dump();

Result

[
'definitions' => [
    'Document' => [
        'type' => 'object',
        'properties' => [
            'tipoDoc' => [
                'type' => 'string'
            ],
            'nroDoc' => [
                'type' => 'string'
            ]
        ]
    ]
  ]
]

The Versions

02/02 2018

dev-master

9999999-dev https://github.com/giansalex/phpobj-swagger

PHP Object to Swagger Definitions

  Sources   Download

MIT

The Requires

 

by Giancarlos Salas

swagger php-objects swagger-definitions

02/02 2018

v1.0.2

1.0.2.0 https://github.com/giansalex/phpobj-swagger

PHP Object to Swagger Definitions

  Sources   Download

MIT

The Requires

 

by Giancarlos Salas

swagger php-objects swagger-definitions

31/01 2018

v1.0.1

1.0.1.0 https://github.com/giansalex/phpobj-swagger

PHP Object to Swagger Definitions

  Sources   Download

MIT

The Requires

 

by Giancarlos Salas

swagger php-objects swagger-definitions

31/01 2018

v1.0.0

1.0.0.0 https://github.com/giansalex/phpobj-swagger

PHP Object to Swagger Definitions

  Sources   Download

MIT

The Requires

 

by Giancarlos Salas

swagger php-objects swagger-definitions