Skip to content

Instantly share code, notes, and snippets.

@ls-dac-chartrand
ls-dac-chartrand / swagit.php
Last active October 21, 2024 19:11
Swag It: Reverse engineer Swagger-PHP annotations from an existing JSON payload
<?php
// -------------------------------------------------------------------------------------
// Add your JSON in the $input to generate Swagger-PHP annotation
// Inspired by: https://github.com/Roger13/SwagDefGen
// HOWTO:
// php -S localhost:8888 -t .
// http://localhost:8888/swagit.php
// -------------------------------------------------------------------------------------