api-platform / api-platform/core

Add multi-language OpenAPI specification

Ouverte
#5,785 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
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.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.