Releases: onmoon/openapi-server-bundle
Releases · onmoon/openapi-server-bundle
Allow installing without minimum stability change
remove minimum-stability dev requirement (#189) Co-authored-by: Patrik Foldes <[email protected]>
Fix compatibility with symfony/yaml 7
fix compatibility with symfony 7 (#187) Co-authored-by: Patrik Foldes <[email protected]>
Symfony 7 support
- Added support for Symfony 7
- Dropped support for Symfony 6.0-6.3
More data added to ResponseEvent
Both RequestHandler and Request objects are now recoverable from the ResponseEvent.
Allow generating custom DateTime classes for date-time fields
You can now specify for each specification what class should be used for serializing and deserializing date
and date-time
fields in this API
open_api_server:
specs:
petstore:
date_time_class: '\Carbon\CarbonImmutable'
The specified class should be an implementation of \DateTimeInterface
Change generated classes structure to reflect types from specification
Changelog
- Generated request and response classes have been completely reworked, to reflect the named types provided in the specification. In general this results in significantly less classes generated, as each type from the specification is now mapped to only one class. Previously there was one class generated per each endpoint that uses a type from the specification.
- The refresh command has been removed (php bin/console open-api:refresh), use the generate command now instead (php bin/console open-api:generate)
Notes on updating to this version
After updating to this version, add an empty implementation of the new \OnMoon\OpenApiServerBundle\Interfaces\ApiLoader::getAllowedCodes
method to your generated ApiServiceLoaderServiceSubscriber
class for the first code generation using the new version of the package to work. When you run the generation for the first time it will replace this empty implementation with a working one.
/**
* This class was automatically generated
* You should not change it manually as it will be overwritten
*/
class ApiServiceLoaderServiceSubscriber implements ApiLoader
{
...
/** @return string[] */
public function getAllowedCodes(string $apiClass, string $dtoClass): array
{
return [];
}
}
Add Symfony request object to RequestDtoEvent
- Added the Symfony request object to RequestDtoEvent
Fix Symfony 6.1 deprecation notices
Fix deprecation notices (#178) Co-authored-by: Patrik Foldes <[email protected]>
Changed RequestDtoEvent
- RequestDtoEvent is triggered now even if the current request has no body and therefore no request DTO
- RequestDtoEvent now contains the request handler class instance too
Replace forked dependencies with upstream
Replaced forked dependencies with upstream packages for:
- cebe/php-openapi
- league/openapi-psr7-validator