api-platform / api-platform/core
Add multi-language OpenAPI specification
- Langage dominant
- PHP
- Étoiles
- 2.6k
- Forks
- 980
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 49
Description
I need multi-language API documentation. For now possible to generate single language only (which use in resource files).
How better to implement it? Build instance of `ApiPlatform\OpenApi\OpenApi` with already translated field or do translation during normalization in `ApiPlatform\OpenApi\Serializer\ApiGatewayNormalizer`?
I think better to translate OpenApi instance and propose to implement `OpenApiFactoryInterface` decorator in follow way:
```
// OpenApiTranslator.php
decorated)($context);
return $this->translator->translate($openApi, $lang);
}
}
```
and fix commad `api:openapi:export` command to check which translation available (or add some argument) and generate translated OpenAPI specifications with some suffix in the filename, e.g. 'openapi_en.json', 'openapi_de.json' and etc.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.