mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-11 15:16:55 +03:00
Add Jane-php recipe for v7 releases (#1377)
See changes applied for new namespaces: - https://github.com/janephp/janephp/commit/806687e995022604dccbdd5fc83d07649abf8d30
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Jane\Component\JsonSchema\Console\Command\GenerateCommand;
|
||||
use Jane\Component\OpenApiCommon\Console\Loader\ConfigLoader;
|
||||
use Jane\Component\OpenApiCommon\Console\Loader\SchemaLoader;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Output\NullOutput;
|
||||
|
||||
$command = new GenerateCommand(new ConfigLoader(), new SchemaLoader());
|
||||
$inputArray = new ArrayInput(['--config-file' => __DIR__ . '/../config/jane/json_schema.php'], $command->getDefinition());
|
||||
|
||||
$command->execute($inputArray, new NullOutput());
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'json-schema-file' => __DIR__ . '/json-schema.json',
|
||||
'root-class' => 'MyModel',
|
||||
'namespace' => 'MyApp\Library\Generated',
|
||||
'directory' => __DIR__ . '/../../generated',
|
||||
];
|
||||
@@ -0,0 +1,6 @@
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
# MyApp\Library\Generated\Normalizer\JaneObjectNormalizer: null
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"bin/": "%BIN_DIR%/",
|
||||
"config/": "%CONFIG_DIR%/"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/symfony": "<5.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
* <fg=blue>Finish</> package configuration:
|
||||
1. Configure <comment>config/jane/json_schema.php</> with your specification details
|
||||
2. Run <comment>bin/jane-json-schema-generate</>
|
||||
3. Add <comment>generated/</> directory to your composer autoload definition (eg. <comment>"MyApp\\Library\\Generated\\": "generated/"</>)
|
||||
4. Open <comment>config/packages/jane.yaml</> and replace <comment>MyApp\Library\Generated\</> namespace with your generated namespace.
|
||||
5. Then remove line comments
|
||||
|
||||
Documentation: https://jane.readthedocs.io/en/latest/
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Jane\Component\OpenApiCommon\Console\Command\GenerateCommand;
|
||||
use Jane\Component\OpenApiCommon\Console\Loader\ConfigLoader;
|
||||
use Jane\Component\OpenApiCommon\Console\Loader\OpenApiMatcher;
|
||||
use Jane\Component\OpenApiCommon\Console\Loader\SchemaLoader;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Output\NullOutput;
|
||||
|
||||
$command = new GenerateCommand(new ConfigLoader(), new SchemaLoader(), new OpenApiMatcher());
|
||||
$inputArray = new ArrayInput(['--config-file' => __DIR__ . '/../config/jane/open_api.php'], $command->getDefinition());
|
||||
|
||||
$command->execute($inputArray, new NullOutput());
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'openapi-file' => __DIR__ . '/open-api.yaml',
|
||||
'namespace' => 'MyApp\Library\Generated',
|
||||
'directory' => __DIR__ . '/../../generated',
|
||||
];
|
||||
@@ -0,0 +1,6 @@
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
# MyApp\Library\Generated\Normalizer\JaneObjectNormalizer: null
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"bin/": "%BIN_DIR%/",
|
||||
"config/": "%CONFIG_DIR%/"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/symfony": "<5.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
* <fg=blue>Finish</> package configuration:
|
||||
1. Configure <comment>config/jane/open_api.php</> with your specification details
|
||||
2. Run <comment>bin/jane-open-api-generate</>
|
||||
3. Add <comment>generated/</> directory to your composer autoload definition (eg. <comment>"MyApp\\Library\\Generated\\": "generated/"</>)
|
||||
4. Open <comment>config/packages/jane.yaml</> and replace <comment>MyApp\Library\Generated\</> namespace with your generated namespace.
|
||||
5. Then remove line comments
|
||||
|
||||
Documentation: https://jane.readthedocs.io/en/latest/
|
||||
Reference in New Issue
Block a user