An open API service indexing awesome lists of open source software.

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

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";

```