{"openapi":"3.0.1","info":{"title":"Welsh Language Translation Service","description":"Provides a capability for service users to maintain Welsh translations.  This enables Welsh Language Support for Professional Users; allowing EXUI users to choose to view the UI in Welsh","version":"v0.0.1"},"externalDocs":{"description":"README","url":"https://github.com/hmcts/ts-translation-service#readme"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"paths":{"/dictionary":{"get":{"tags":["dictionary-controller"],"summary":"Download a set of phrases potentially associated with a case type for which translations will be eventually added.","description":"Users calling this endpoint must have the `manage-translations` role","operationId":"getDictionary","responses":{"200":{"description":"Dictionary returned successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dictionary"}}}},"401":{"description":"Authentication failure due to invalid / expired tokens (IDAM / S2S)."},"403":{"description":"One of the following reasons:\n1. Unauthorised S2S service.\n2. User does not have 'manage-translations' role."}}},"put":{"tags":["dictionary-controller"],"summary":"Upload a set of phrases for which translations may be provided.","description":"If user's current IDAM role is `manage-translations`\n\n\t - User can submit English phrases with/without corresponding Welsh translations\n\nIf user's current IDAM role is `load-translations`\n\n\t - User can submit English phrases only\n\nIf calling service is on approved list of services for this endpoint that don't need to supply  Authorization header: then\n\n\t - this endpoint can be called without supplying IDAM credentials (Authorization header) - Service to Service authorization (ServiceAuthorization header) is still required.\n\n\t - calling service can only submit English phrases\n\n","operationId":"putDictionary","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dictionary"}}},"required":true},"responses":{"201":{"description":"Success"},"400":{"description":"One of the following reasons:\n1. Bad Request (001 bad schema)\n2. Bad Request (002 Welsh not allowed for this user)\n"},"401":{"description":"Authentication failure due to invalid / expired tokens (IDAM / S2S)."},"403":{"description":"One of the following reasons:\n1. Unauthorised S2S service.\n2. The request should be from a valid service or the User does not have 'manage-translations,load-translations' role."}}}},"/translation/cy":{"post":{"tags":["dictionary-controller"],"summary":"Get the Welsh translation of the provided set of English phrases.","description":"User does not require any specific roles to call this endpoint\n\nThis endpoint can be called without supplying IDAM credentials (Authorization header) - Service to Service authorization (ServiceAuthorization header) is still required.","operationId":"getTranslation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationsRequest"}}},"required":true},"responses":{"200":{"description":"Translation returned successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dictionary"}}}},"400":{"description":"Bad Request (001 bad schema)"},"401":{"description":"Authentication failure due to invalid / expired tokens (IDAM / S2S)."},"403":{"description":"Unauthorised S2S service."}}}}},"components":{"schemas":{"Dictionary":{"type":"object","properties":{"translations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Translation"},"description":"A map of phrases and corresponding translation object (with possibly not yet provided translation)","example":"{\"English phrase 1\": {\"translation\":\"\"},\"English phrase 2\": {\"translation\":\"Welsh translation 1\"},\"English phrase 3\": {\"translation\": \"Welsh translation 1\", \"yesOrNo\":  true,\"yes\": \"Welsh Yes Translation\",\"no\": \"Welsh No Translation\",}}"}}},"Translation":{"type":"object","properties":{"translation":{"type":"string"},"yesOrNo":{"type":"boolean"},"yes":{"type":"string"},"no":{"type":"string"}},"description":"A map of phrases and corresponding translation object (with possibly not yet provided translation)","example":"{\"English phrase 1\": {\"translation\":\"\"},\"English phrase 2\": {\"translation\":\"Welsh translation 1\"},\"English phrase 3\": {\"translation\": \"Welsh translation 1\", \"yesOrNo\":  true,\"yes\": \"Welsh Yes Translation\",\"no\": \"Welsh No Translation\",}}"},"TranslationsRequest":{"required":["phrases"],"type":"object","properties":{"phrases":{"uniqueItems":true,"type":"array","description":"A set of phrases for which translations may be provided.","example":["English Phrase 1","English Phrase 2","English Phrase 3"],"items":{"type":"string","description":"A set of phrases for which translations may be provided.","example":"[\"English Phrase 1\",\"English Phrase 2\",\"English Phrase 3\"]"}}}}},"securitySchemes":{"Authorization":{"type":"http","description":"Valid IDAM user token, (Bearer keyword is added automatically)","name":"Authorization","scheme":"bearer","bearerFormat":"JWT"},"ServiceAuthorization":{"type":"apiKey","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","name":"ServiceAuthorization","in":"header","scheme":"bearer","bearerFormat":"JWT"}}}}
