ttt/openapi-model-creator

Create models from an OpenAPI json file

1.1.0 2021-12-02 16:07 UTC

This package is auto-updated.

Last update: 2024-04-29 04:59:46 UTC


README

Openapi spec: https://spec.openapis.org/oas/v3.0.0.html

Requires: https://packagist.org/packages/spatie/enum

Examples

<?php

require __DIR__ . '/vendor/autoload.php';

$creator = new \TTT\OpenApi\Creator(
    __DIR__ . '/openapi.json',
    'TTT\Project\Model',
    '/my-project/Model/',
);

var_dump($creator->saveAll());

<?php

require __DIR__ . '/vendor/autoload.php';

$creator = new \TTT\OpenApi\Creator(
    __DIR__ . '/openapi.json',
    'TTT\Project\Model',
    '/my-project/Model/',
);

$filter = [
    'Schema1',
    'Schema2',
];

var_dump($creator->saveSchemas($filter));

var_dump($creator->saveHelpers());