UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 8.12 kB
{"openapi":"3.0.0","info":{"contact":{"x-twitter":"languagetoolorg"},"description":"Check texts for style and grammar issues with LanguageTool","title":"LanguageTool","version":"1.0.2","x-apisguru-categories":["text"],"x-logo":{"url":"https://twitter.com/languagetoolorg/profile_image?size=original"},"x-origin":[{"format":"swagger","url":"https://languagetool.org/http-api/languagetool-swagger.json","version":"2.0"}],"x-providerName":"languagetool.org"},"paths":{"/check":{"post":{"description":"The main feature - check a text with LanguageTool for possible style and grammar issues.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"text":{"description":"The text to be checked. This or 'data' is required.","type":"string"},"data":{"description":"The text to be checked, given as a JSON document that specifies what's text and what's markup. This or 'text' is required. Markup will be ignored when looking for errors. Example text: <pre>A &lt;b>test&lt;/b></pre>JSON for the example text: <pre>{\"annotation\":[\n {\"text\": \"A \"},\n {\"markup\": \"&lt;b>\"},\n {\"text\": \"test\"},\n {\"markup\": \"&lt;/b>\"}\n]}</pre> <p>If you have markup that should be interpreted as whitespace, like <tt>&lt;p&gt;</tt> in HTML, you can have it interpreted like this: <pre>{\"markup\": \"&lt;p&gt;\", \"interpretAs\": \"\\n\\n\"}</pre><p>The 'data' feauture is not limited to HTML or XML, it can be used for any kind of markup.","type":"string"},"language":{"description":"A language code like `en-US`, `de-DE`, `fr`, or `auto` to guess the language automatically (see `preferredVariants` below). For languages with variants (English, German, Portuguese) spell checking will only be activated when you specify the variant, e.g. `en-GB` instead of just `en`.","type":"string"},"altLanguages":{"description":"EXPERIMENTAL: Comma-separated list of language codes to check if a word is not similar to one of the main language (parameter `language`). Unknown words that are similar to a word from the main language will still be considered errors but with type `Hint`. For languages with variants (English, German, Portuguese) you need to specify the variant, e.g. `en-GB` instead of just `en`.","type":"string"},"motherTongue":{"description":"A language code of the user's native language, enabling false friends checks for some language pairs.","type":"string"},"preferredVariants":{"description":"Comma-separated list of preferred language variants. The language detector used with `language=auto` can detect e.g. English, but it cannot decide whether British English or American English is used. Thus this parameter can be used to specify the preferred variants like `en-GB` and `de-AT`. Only available with `language=auto`.","type":"string"},"enabledRules":{"description":"IDs of rules to be enabled, comma-separated","type":"string"},"disabledRules":{"description":"IDs of rules to be disabled, comma-separated","type":"string"},"enabledCategories":{"description":"IDs of categories to be enabled, comma-separated","type":"string"},"disabledCategories":{"description":"IDs of categories to be disabled, comma-separated","type":"string"},"enabledOnly":{"description":"If true, only the rules and categories whose IDs are specified with `enabledRules` or `enabledCategories` are enabled.","type":"boolean","default":false}},"required":["language"]}}}},"responses":{"200":{"description":"the result of checking the text","content":{"application/json":{"schema":{"properties":{"language":{"description":"The language used for checking the text.","properties":{"code":{"description":"ISO 639-1 code like 'en', 'en-US', or 'ca-ES-valencia'.","type":"string"},"detectedLanguage":{"description":"The automatically detected text language (might be different from the language actually used for checking).","properties":{"code":{"description":"ISO 639-1 code like 'en', 'en-US', or 'ca-ES-valencia'.","type":"string"},"confidence":{"description":"Estimate of the probability of the submitted text being in the detected language. Between 0 and 1.","type":"number"},"name":{"description":"Language name like 'French' or 'English (US)'.","type":"string"}},"required":["name","code"],"type":"object"},"name":{"description":"Language name like 'French' or 'English (US)'.","type":"string"}},"required":["name","code","detectedLanguage"],"type":"object"},"matches":{"items":{"properties":{"context":{"properties":{"length":{"description":"The length of the error in characters in the context.","type":"integer"},"offset":{"description":"The 0-based character offset of the error in the context text.","type":"integer"},"text":{"description":"Context of the error, i.e. the error and some text to the left and to the left.","type":"string"}},"required":["text","offset","length"],"type":"object"},"length":{"description":"The length of the error in characters.","type":"integer"},"message":{"description":"Message about the error displayed to the user.","type":"string"},"offset":{"description":"The 0-based character offset of the error in the text.","type":"integer"},"replacements":{"description":"Replacements that might correct the error. The array can be empty, in this case there is no suggested replacement.","items":{"properties":{"value":{"description":"the replacement string","type":"string"}},"type":"object"},"type":"array"},"rule":{"properties":{"category":{"properties":{"id":{"description":"A category's identifier that's unique for this language.","type":"string"},"name":{"description":"A short description of the category.","type":"string"}},"type":"object"},"description":{"type":"string"},"id":{"description":"An rule's identifier that's unique for this language.","type":"string"},"issueType":{"description":"The <a href=\"http://www.w3.org/International/multilingualweb/lt/drafts/its20/its20.html#lqissue-typevalues\">Localization Quality Issue Type</a>. This is not defined for all languages, in which case it will always be 'Uncategorized'.","type":"string"},"subId":{"description":"An optional sub identifier of the rule, used when several rules are grouped.","type":"string"},"urls":{"description":"An optional array of URLs with a more detailed description of the error.","items":{"properties":{"value":{"description":"the URL","type":"string"}},"type":"object"},"type":"array"}},"required":["id","description","category"],"type":"object"},"sentence":{"description":"The sentence the error occurred in (since LanguageTool 4.0 or later)","type":"string"},"shortMessage":{"description":"An optional shorter version of 'message'.","type":"string"}},"required":["message","offset","length","replacements","context","sentence"],"type":"object"},"type":"array"},"software":{"properties":{"apiVersion":{"description":"Version of this API response. We don't expect to make incompatible changes, so this can also be increased for newly added fields.","type":"integer"},"buildDate":{"description":"Date when the software was built, e.g. '2016-05-25'.","type":"string"},"name":{"description":"Usually 'LanguageTool'.","type":"string"},"premium":{"description":"true if you're using a Premium account with all the premium text checks (since LanguageTool 4.2)","type":"boolean"},"status":{"description":"An optional warning, e.g. when the API format is not stable.","type":"string"},"version":{"description":"A version string like '3.3' or '3.4-SNAPSHOT'.","type":"string"}},"required":["name","version","buildDate","apiVersion"],"type":"object"}}}}}}},"summary":"Check a text"}},"/languages":{"get":{"responses":{"200":{"description":"An array of language objects.","content":{"application/json":{"schema":{"items":{"properties":{"code":{"description":"a language code like 'en'","type":"string"},"longCode":{"description":"a language code like 'en-US' or 'ca-ES-valencia'","type":"string"},"name":{"description":"a language name like 'French' or 'English (Australia)'","type":"string"}},"required":["name","code","longCode"],"type":"object"},"type":"array"}}}}},"summary":"Get a list of supported languages."}}},"servers":[{"url":"https://languagetool.org/api/v2"}]}