Convert swagger models to typescript type definitions (d.ts)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
bin
src/SwagTS
tests
.gitignore
LICENCE
README.md
composer.json
composer.lock
composer.phar
phpunit.xml

README.md

SwagTS

Scans Swagger Models to create TypeScript type definitions (d.ts)

Usage

from swagger json

use SwagTS\Providers\JSONSchema;
use SwagTS\Writer;

$provider = new JSONSchema(['json_schema' => file_get_contents('https://api.timepad.ru/doc/swag/Timepad%20API.json')]);
$w = new Writer($p);
$converted = $w->makeModule("MyDesiredTSNamespace");

From swagger-php models

use SwagTS\Providers\SwaggerPHP;
use SwagTS\Writer;

$provider = new SwaggerPHP(['directory' => "src/Whatever/MySwaggerStuff/", 'resource' => '/']);
$w = new Writer($provider);
$converted = $w->makeModule("MyDesiredTSNamespace");