api-platform / api-platform/core
Add multi-language OpenAPI specification
- Lenguaje dominante
- PHP
- Estrellas
- 2.6k
- Forks
- 980
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 49
Descripción
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.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.