Ver a proveniência

auto export forms

master
Daniel há 2 anos
ascendente
cometimento
c49dc2c2ef
7 ficheiros alterados com 108 adições e 3 eliminações
  1. +4
    -1
      README.md
  2. +2
    -1
      composer.json
  3. +82
    -1
      composer.lock
  4. +1
    -0
      config/packages/api_platform.yaml
  5. +18
    -0
      export/exportApi.php
  6. +1
    -0
      export/openapi.json
  7. +0
    -0
      export/openapi.yaml

+ 4
- 1
README.md Ver ficheiro

@@ -116,4 +116,7 @@

# List Routes and Service Tags
- ddev exec bin/console debug:router
- ddev exec bin/console debug:container
- ddev exec bin/console debug:container

# Constraints
- https://symfony.com/doc/current/validation.html

+ 2
- 1
composer.json Ver ficheiro

@@ -44,7 +44,8 @@
"symfonycasts/micro-mapper": "^0.1.4",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0",
"vich/uploader-bundle": "^2.3"
"vich/uploader-bundle": "^2.3",
"zircote/swagger-php": "^4.8"
},
"config": {
"allow-plugins": {


+ 82
- 1
composer.lock Ver ficheiro

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e41f83bf907500bc2cae3d1f8eb56816",
"content-hash": "c9bac256c39d8d375145ec076da8a3cc",
"packages": [
{
"name": "api-platform/core",
@@ -8101,6 +8101,87 @@
"source": "https://github.com/willdurand/Negotiation/tree/3.1.0"
},
"time": "2022-01-30T20:08:53+00:00"
},
{
"name": "zircote/swagger-php",
"version": "4.8.4",
"source": {
"type": "git",
"url": "https://github.com/zircote/swagger-php.git",
"reference": "bdee7f5a9216ce103ba2c953c1c43c4a3e139e4c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zircote/swagger-php/zipball/bdee7f5a9216ce103ba2c953c1c43c4a3e139e4c",
"reference": "bdee7f5a9216ce103ba2c953c1c43c4a3e139e4c",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=7.2",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"symfony/deprecation-contracts": "^2 || ^3",
"symfony/finder": ">=2.2",
"symfony/yaml": ">=3.3"
},
"require-dev": {
"composer/package-versions-deprecated": "^1.11",
"doctrine/annotations": "^1.7 || ^2.0",
"friendsofphp/php-cs-fixer": "^2.17 || ^3.47.1",
"phpstan/phpstan": "^1.6",
"phpunit/phpunit": ">=8",
"vimeo/psalm": "^4.23"
},
"suggest": {
"doctrine/annotations": "^1.7 || ^2.0"
},
"bin": [
"bin/openapi"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
}
},
"autoload": {
"psr-4": {
"OpenApi\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Robert Allen",
"email": "zircote@gmail.com"
},
{
"name": "Bob Fanger",
"email": "bfanger@gmail.com",
"homepage": "https://bfanger.nl"
},
{
"name": "Martin Rademacher",
"email": "mano@radebatz.net",
"homepage": "https://radebatz.net"
}
],
"description": "swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations",
"homepage": "https://github.com/zircote/swagger-php/",
"keywords": [
"api",
"json",
"rest",
"service discovery"
],
"support": {
"issues": "https://github.com/zircote/swagger-php/issues",
"source": "https://github.com/zircote/swagger-php/tree/4.8.4"
},
"time": "2024-02-04T21:16:47+00:00"
}
],
"packages-dev": [


+ 1
- 0
config/packages/api_platform.yaml Ver ficheiro

@@ -8,6 +8,7 @@ api_platform:
jsonhal: [ 'application/hal+json' ]
docs_formats:
jsonld: ['application/ld+json']
json: [ 'application/json' ]
jsonopenapi: ['application/vnd.openapi+json']
html: ['text/html']
defaults:


+ 18
- 0
export/exportApi.php Ver ficheiro

@@ -0,0 +1,18 @@
<?php

shell_exec('ddev exec rm /var/www/html/export/openapi.yaml');
shell_exec('ddev exec rm /var/www/html/export/openapi.json');
shell_exec('ddev exec bin/console api:openapi:export --yaml >> openapi.yaml');


// URL der JSON-Datei
$jsonUrl = 'https://matsen-tool-be.ddev.site:8443/api/docs.json';

// JSON von der URL abrufen
$jsonData = file_get_contents($jsonUrl);

// Pfad, um die JSON-Datei zu speichern (lokaler Dateipfad)
$savePath = 'openapi.json';

// JSON-Datei speichern
file_put_contents($savePath, $jsonData);

+ 1
- 0
export/openapi.json
A apresentação das diferenças no ficheiro foi suprimida por ser demasiado grande
Ver ficheiro


openapi.yaml → export/openapi.yaml Ver ficheiro


Carregando…
Cancelar
Guardar