https://github.com/dcarbone/json-modeler
Utility for converting JSON into language-specific models
https://github.com/dcarbone/json-modeler
jsonmodel php
Last synced: 12 months ago
JSON representation
Utility for converting JSON into language-specific models
- Host: GitHub
- URL: https://github.com/dcarbone/json-modeler
- Owner: dcarbone
- License: mit
- Created: 2017-10-02T18:06:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-06T01:12:58.000Z (over 2 years ago)
- Last Synced: 2024-12-31T04:22:41.298Z (about 1 year ago)
- Topics: jsonmodel, php
- Language: PHP
- Size: 65.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-modeler
Utility for converting JSON into language-specific models
## Composer
```json
{
"require": {
"dcarbone/json-modeler": "@stable"
}
}
```
## Basic Usage
```php
// Initialize Langauges
$goConf = new \DCarbone\JSONModeler\Languages\GO\GOConfiguration([
// @see ./src/JONSModeler/Langauges/GO/GOConfiguration.php for options
]);
$go = new \DCarbone\JSONModeler\Languages\GO\GOLanguage();
// Create Modeler instance
$modeler = new \DCarbone\JSONModeler([$go]);
// Get some JSON
$json = <<generate('MyTypeName', $json, 'golang');
// $models is now a string containing the GO types based upon the json input.
echo $models;
echo "\n";
```