'Symfony 4.4 Translation Annotations Nelmio ApiDoc

I have a symfony 4.4 project with enabled translations and now I have to find a solution that translations also take effect for swagger annotations. The result has to translate the description attribute of these annotations. Nelmio ApiDoc Bundle to v3.10.1 My annotation is:

 * @Operation(
 *     tags={"02.02 X - Y"},
 *     summary="Set a ....",
 *     @SWG\Parameter(
 *         name="VideoBitRate",
 *         in="formData",
 *         description="encoding.vbitrate",
 *         required=false,
 *         type="string"
 *     ),
 *     ....

Translation is working for the whole project, only for the description of the defined Swagger Parameters it does not work. The Nelmio docs are small and I cant find anything related. My ideas are:

  • overwrite the docExtractor from Nelmio (no idea how - with the old version I could do this)
  • overwrite the AnnotatiosReader but I dont understand how exactly NelmioApiDocBundle generates the APIDocs with the new Version or with which AnnotationReader.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source