Skip to content

Change generated classes structure to reflect types from specification

Compare
Choose a tag to compare
@sspat sspat released this 04 May 13:24
· 6 commits to master since this release
1aec01f

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 [];
    }
}