Skip to content

Commit 6a4a452

Browse files
refactor: Merge duplicate SourceLanguageText schema into SourceLanguage
Consolidates the redundant SourceLanguageText and SourceLanguage schemas into a single SourceLanguage schema. After the previous commit expanded both schemas to include the same 112 language codes, these schemas became identical and maintaining both added unnecessary duplication. Changes: - Replace all references to SourceLanguageText with SourceLanguage - Remove SourceLanguageText schema definition from both YAML and JSON specs - Update CHANGELOG to document this refactoring This simplifies maintenance by ensuring there's only one source language schema to update when languages are added or modified. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f298e0b commit 6a4a452

File tree

3 files changed

+9
-502
lines changed

3 files changed

+9
-502
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ typos, schema fixes, or adding examples.
2222
*
2323
* Fixes the usage endpoint response object name. Should be `key_usages` and `key_and_day_usages` instead of `grouped_usage`
2424
* Add all supported languages to Translate API `source_lang` and `target_lang` specs
25+
* Merge redundant `SourceLanguageText` and `TargetLanguageText` schemas into `SourceLanguage` and `TargetLanguage` to eliminate duplication
2526

2627
### Deprecated
2728
* Removed the `openapi_gitbook.yaml` file due to redundancy. Please use `openapi.yaml` going forward

openapi.json

Lines changed: 4 additions & 250 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@
8383
}
8484
},
8585
"source_lang": {
86-
"$ref": "#/components/schemas/SourceLanguageText"
86+
"$ref": "#/components/schemas/SourceLanguage"
8787
},
8888
"target_lang": {
89-
"$ref": "#/components/schemas/TargetLanguageText"
89+
"$ref": "#/components/schemas/TargetLanguage"
9090
},
9191
"context": {
9292
"$ref": "#/components/schemas/Context"
@@ -206,10 +206,10 @@
206206
}
207207
},
208208
"source_lang": {
209-
"$ref": "#/components/schemas/SourceLanguageText"
209+
"$ref": "#/components/schemas/SourceLanguage"
210210
},
211211
"target_lang": {
212-
"$ref": "#/components/schemas/TargetLanguageText"
212+
"$ref": "#/components/schemas/TargetLanguage"
213213
},
214214
"context": {
215215
"$ref": "#/components/schemas/Context"
@@ -5668,127 +5668,6 @@
56685668
],
56695669
"example": "EN"
56705670
},
5671-
"SourceLanguageText": {
5672-
"type": "string",
5673-
"description": "Language of the text to be translated. If this parameter is omitted, the API will attempt to detect the language of the text and translate it.\n\n**Note:** Some languages only work with `model_type` set to `quality_optimized`. See [supported languages](https://developers.deepl.com/docs/getting-started/supported-languages) for more details.",
5674-
"enum": [
5675-
"ACE",
5676-
"AF",
5677-
"AN",
5678-
"AR",
5679-
"AS",
5680-
"AY",
5681-
"AZ",
5682-
"BA",
5683-
"BE",
5684-
"BG",
5685-
"BHO",
5686-
"BN",
5687-
"BR",
5688-
"BS",
5689-
"CA",
5690-
"CEB",
5691-
"CKB",
5692-
"CS",
5693-
"CY",
5694-
"DA",
5695-
"DE",
5696-
"EL",
5697-
"EN",
5698-
"EO",
5699-
"ES",
5700-
"ET",
5701-
"EU",
5702-
"FA",
5703-
"FI",
5704-
"FR",
5705-
"GA",
5706-
"GL",
5707-
"GN",
5708-
"GOM",
5709-
"GU",
5710-
"HA",
5711-
"HE",
5712-
"HI",
5713-
"HR",
5714-
"HT",
5715-
"HU",
5716-
"HY",
5717-
"ID",
5718-
"IG",
5719-
"IS",
5720-
"IT",
5721-
"JA",
5722-
"JV",
5723-
"KA",
5724-
"KK",
5725-
"KMR",
5726-
"KO",
5727-
"KY",
5728-
"LA",
5729-
"LB",
5730-
"LMO",
5731-
"LN",
5732-
"LT",
5733-
"LV",
5734-
"MAI",
5735-
"MG",
5736-
"MI",
5737-
"MK",
5738-
"ML",
5739-
"MN",
5740-
"MR",
5741-
"MS",
5742-
"MT",
5743-
"MY",
5744-
"NB",
5745-
"NE",
5746-
"NL",
5747-
"OC",
5748-
"OM",
5749-
"PA",
5750-
"PAG",
5751-
"PAM",
5752-
"PL",
5753-
"PRS",
5754-
"PS",
5755-
"PT",
5756-
"QU",
5757-
"RO",
5758-
"RU",
5759-
"SA",
5760-
"SCN",
5761-
"SK",
5762-
"SL",
5763-
"SQ",
5764-
"SR",
5765-
"ST",
5766-
"SU",
5767-
"SV",
5768-
"SW",
5769-
"TA",
5770-
"TE",
5771-
"TG",
5772-
"TH",
5773-
"TK",
5774-
"TL",
5775-
"TN",
5776-
"TR",
5777-
"TS",
5778-
"TT",
5779-
"UK",
5780-
"UR",
5781-
"UZ",
5782-
"VI",
5783-
"WO",
5784-
"XH",
5785-
"YI",
5786-
"YUE",
5787-
"ZH",
5788-
"ZU"
5789-
],
5790-
"example": "EN"
5791-
},
57925671
"TagHandlingOption": {
57935672
"description": "Sets which kind of tags should be handled. Options currently available:\n * `xml`: Enable XML tag handling; see [XML Handling](https://www.deepl.com/docs-api/xml).\n * `html`: Enable HTML tag handling; see [HTML Handling](https://www.deepl.com/docs-api/html).",
57945673
"type": "string",
@@ -6089,131 +5968,6 @@
60895968
],
60905969
"example": "DE"
60915970
},
6092-
"TargetLanguageText": {
6093-
"type": "string",
6094-
"description": "The language into which the text should be translated.\n\n**Note:** Some languages only work with `model_type` set to `quality_optimized`. See [supported languages](https://developers.deepl.com/docs/getting-started/supported-languages) for more details.",
6095-
"enum": [
6096-
"ACE",
6097-
"AF",
6098-
"AN",
6099-
"AR",
6100-
"AS",
6101-
"AY",
6102-
"AZ",
6103-
"BA",
6104-
"BE",
6105-
"BG",
6106-
"BHO",
6107-
"BN",
6108-
"BR",
6109-
"BS",
6110-
"CA",
6111-
"CEB",
6112-
"CKB",
6113-
"CS",
6114-
"CY",
6115-
"DA",
6116-
"DE",
6117-
"EL",
6118-
"EN-GB",
6119-
"EN-US",
6120-
"EO",
6121-
"ES",
6122-
"ES-419",
6123-
"ET",
6124-
"EU",
6125-
"FA",
6126-
"FI",
6127-
"FR",
6128-
"GA",
6129-
"GL",
6130-
"GN",
6131-
"GOM",
6132-
"GU",
6133-
"HA",
6134-
"HE",
6135-
"HI",
6136-
"HR",
6137-
"HT",
6138-
"HU",
6139-
"HY",
6140-
"ID",
6141-
"IG",
6142-
"IS",
6143-
"IT",
6144-
"JA",
6145-
"JV",
6146-
"KA",
6147-
"KK",
6148-
"KMR",
6149-
"KO",
6150-
"KY",
6151-
"LA",
6152-
"LB",
6153-
"LMO",
6154-
"LN",
6155-
"LT",
6156-
"LV",
6157-
"MAI",
6158-
"MG",
6159-
"MI",
6160-
"MK",
6161-
"ML",
6162-
"MN",
6163-
"MR",
6164-
"MS",
6165-
"MT",
6166-
"MY",
6167-
"NB",
6168-
"NE",
6169-
"NL",
6170-
"OC",
6171-
"OM",
6172-
"PA",
6173-
"PAG",
6174-
"PAM",
6175-
"PL",
6176-
"PRS",
6177-
"PS",
6178-
"PT-BR",
6179-
"PT-PT",
6180-
"QU",
6181-
"RO",
6182-
"RU",
6183-
"SA",
6184-
"SCN",
6185-
"SK",
6186-
"SL",
6187-
"SQ",
6188-
"SR",
6189-
"ST",
6190-
"SU",
6191-
"SV",
6192-
"SW",
6193-
"TA",
6194-
"TE",
6195-
"TG",
6196-
"TH",
6197-
"TK",
6198-
"TL",
6199-
"TN",
6200-
"TR",
6201-
"TS",
6202-
"TT",
6203-
"UK",
6204-
"UR",
6205-
"UZ",
6206-
"VI",
6207-
"WO",
6208-
"XH",
6209-
"YI",
6210-
"YUE",
6211-
"ZH-HANS",
6212-
"ZH-HANT",
6213-
"ZU"
6214-
],
6215-
"example": "DE"
6216-
},
62175971
"TargetLanguageWrite": {
62185972
"type": "string",
62195973
"description": "The language for the text improvement. Options currently available:\n * `de` - German\n * `en` - English (unspecified variant, defaults to `en-US`)\n * `en-GB` - English (British)\n * `en-US` - English (American)\n * `es` - Spanish\n * `fr` - French\n * `it` - Italian\n * `pt` - Portuguese (unspecified variant, defaults to `pt-PT`)\n * `pt-BR` - Portuguese (Brazilian)\n * `pt-PT` - Portuguese (all Portuguese variants excluding Brazilian Portuguese)",

0 commit comments

Comments
 (0)