Skip to content

Commit

Permalink
chore: Upgraded liform bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Jul 24, 2024
1 parent 9b3fb40 commit 1fadc51
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 32 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"ext-zip": "*",
"ext-json": "*",
"ext-mbstring": "*",
"api-platform/core": "~3.2.14",
"api-platform/core": "~3.3.11",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.8.1",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/orm": "~2.19.0",
"gedmo/doctrine-extensions": "^3.10.0",
"gedmo/doctrine-extensions": "^3.16.1",
"inlinestyle/inlinestyle": "~1.2.7",
"james-heinrich/getid3": "^1.9",
"jms/serializer": "^3.9.0",
Expand All @@ -41,7 +41,7 @@
"phpoffice/phpspreadsheet": "^1.15",
"ramsey/uuid": "^4.7",
"rezozero/intervention-request-bundle": "~3.0.0",
"rezozero/liform-bundle": "^0.19",
"rezozero/liform-bundle": "^0.20.1",
"rezozero/tree-walker": "^1.5.0",
"roadiz/doc-generator": "2.4.x-dev",
"roadiz/documents": "2.4.x-dev",
Expand Down
71 changes: 51 additions & 20 deletions config/packages/api_platform.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,78 @@
parameters:
env(HTTP_CACHE_STALE_WHILE_REVALIDATE): 3600
env(HTTP_CACHE_MAX_AGE): 60
env(HTTP_CACHE_SHARED_MAX_AGE): 600

api_platform:
patch_formats:
json: ['application/merge-patch+json']
enable_swagger_ui: false
title: "%env(string:APP_TITLE)%"
description: "%env(string:APP_DESCRIPTION)%"
version: '%env(string:APP_VERSION)%'
enable_swagger_ui: true
enable_re_doc: true
# Symfony inflector wrongly pluralizes "nodes_sources" to "nodes_sourcess"
keep_legacy_inflector: true
use_symfony_listeners: true
formats:
jsonld: ['application/ld+json']
json: ['application/json']
x-www-form-urlencoded: ['application/x-www-form-urlencoded']
docs_formats:
jsonld: ['application/ld+json']
jsonopenapi: ['application/vnd.openapi+json']
html: ['text/html']
patch_formats:
json: [ 'application/merge-patch+json' ]
graphql:
introspection: '%kernel.debug%'
graphiql:
enabled: false
graphql_playground:
enabled: false
show_webby: false
swagger:
versions: [3]
title: "%env(string:APP_TITLE)%"
description: "%env(string:APP_DESCRIPTION)%"
version: '%env(string:APP_VERSION)%'
mapping:
paths:
- '%kernel.project_dir%/src/Entity'
- '%kernel.project_dir%/src/GeneratedEntity'
- '%kernel.project_dir%/vendor/roadiz/core-bundle/src/Entity'
- '%kernel.project_dir%/vendor/rezozero/tree-walker/src'
- '%kernel.project_dir%/config/api_resources'

collection:
pagination:
page_parameter_name: page
items_per_page_parameter_name: itemsPerPage

http_cache:
invalidation:
enabled: true
varnish_urls: [ '%env(VARNISH_URL)%' ]

swagger:
versions: [3]
defaults:
stateless: true
extra_properties:
standard_put: true
rfc_7807_compliant_errors: false
enable_max_depth: true
normalization_context:
skip_null_values: true
pagination_client_items_per_page: true
pagination_items_per_page: 15
pagination_maximum_items_per_page: 50
cache_headers:
# Automatically generate etags for API responses.
etag: true
public: true
# Default value for the response max age.
max_age: '%env(int:HTTP_CACHE_MAX_AGE)%'
# Default value for the response shared (proxy) max age.
shared_max_age: '%env(int:HTTP_CACHE_SHARED_MAX_AGE)%'
vary: [ 'Accept', 'Authorization', 'Origin', 'Accept-Encoding', 'Content-Type' ]
stale_while_revalidate: '%env(int:HTTP_CACHE_STALE_WHILE_REVALIDATE)%'
# Default values of the "Vary" HTTP header.
vary: ['Accept', 'Authorization', 'Origin', 'Accept-Encoding', 'Content-Type']
collection:
pagination:
items_per_page_parameter_name: itemsPerPage

when@prod:
api_platform:
graphql:
introspection: false
graphiql:
enabled: false
graphql_playground:
enabled: false
http_cache:
invalidation:
enabled: true
varnish_urls: [ '%env(VARNISH_URL)%' ]
1 change: 1 addition & 0 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ framework:
serializer:
circular_reference_handler: 'RZ\Roadiz\CoreBundle\Serializer\CircularReferenceHandler'
max_depth_handler: 'RZ\Roadiz\CoreBundle\Serializer\CircularReferenceHandler'
handle_all_throwables: true
csrf_protection:
enabled: true

Expand Down
6 changes: 3 additions & 3 deletions src/Api/Controller/GetWebResponseByPathController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace RZ\Roadiz\CoreBundle\Api\Controller;

use ApiPlatform\Api\IriConverterInterface;
use ApiPlatform\Exception\InvalidArgumentException;
use ApiPlatform\Exception\ResourceClassNotFoundException;
use ApiPlatform\Metadata\IriConverterInterface;
use ApiPlatform\Metadata\Exception\InvalidArgumentException;
use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException;
use ApiPlatform\Metadata\Exception\OperationNotFoundException;
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
use Psr\Log\LoggerInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Filter/ArchiveFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use ApiPlatform\Doctrine\Orm\Filter\AbstractFilter;
use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Exception\FilterValidationException;
use ApiPlatform\Metadata\Exception\FilterValidationException;
use ApiPlatform\Metadata\Operation;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Filter/IntersectionFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Doctrine\Orm\Filter\AbstractFilter;
use ApiPlatform\Exception\FilterValidationException;
use ApiPlatform\Metadata\Exception\FilterValidationException;
use ApiPlatform\Metadata\Operation;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Filter/LocaleFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace RZ\Roadiz\CoreBundle\Api\Filter;

use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Exception\FilterValidationException;
use ApiPlatform\Metadata\Exception\FilterValidationException;
use ApiPlatform\Metadata\Operation;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ManagerRegistry;
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/NodesSourcesAddHeadersSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace RZ\Roadiz\CoreBundle\EventSubscriber;

use ApiPlatform\Util\RequestAttributesExtractor;
use ApiPlatform\State\Util\RequestAttributesExtractor;
use RZ\Roadiz\CoreBundle\Api\Model\WebResponseInterface;
use RZ\Roadiz\CoreBundle\Entity\NodesSources;
use RZ\Roadiz\CoreBundle\Preview\PreviewResolverInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Serializer/CircularReferenceHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace RZ\Roadiz\CoreBundle\Serializer;

use ApiPlatform\Api\IriConverterInterface;
use ApiPlatform\Api\UrlGeneratorInterface;
use ApiPlatform\Metadata\IriConverterInterface;
use ApiPlatform\Metadata\UrlGeneratorInterface;

final class CircularReferenceHandler
{
Expand Down

0 comments on commit 1fadc51

Please sign in to comment.