api-platform / api-platform/core
Add multi-language OpenAPI specification
- 主要言語
- PHP
- スター
- 2.6k
- フォーク
- 980
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 49
説明
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.
コントリビューションガイド
評価
この issue はまだ評価されていません。