Skip to content

Commit

Permalink
Set storeSerialized to false in the readme cache example (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
NanoSector authored Apr 11, 2024
1 parent dd4843b commit efb28f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ In order to activate this cache, you can pass a PSR-6 cache instance to the stat
use Gertjuhh\SymfonyOpenapiValidator\StaticOpenApiValidatorCache;
use Symfony\Component\Cache\Adapter\ArrayAdapter;

StaticOpenApiValidatorCache::$validatorCache = new ArrayAdapter();
StaticOpenApiValidatorCache::$validatorCache = new ArrayAdapter(storeSerialized: false);
```

Setting `storeSerialized` to false on the ArrayAdapter instance is recommended as it lowers memory usage by storing the actual objects;
otherwise, Symfony will store a serialized representation of the OpenAPI schema and deserialize it on every test run.

This snippet can be embedded in a bootstrap script for PHPUnit.

## Example
Expand Down

0 comments on commit efb28f9

Please sign in to comment.