{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-natural-language/json-schema/google-cloud-natural-language-moderate-text-response-schema.json",
  "title": "ModerateTextResponse",
  "description": "The document moderation response message.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-natural-language-documents-api-openapi.yml#/components/schemas/ModerateTextResponse",
  "type": "object",
  "properties": {
    "moderationCategories": {
      "description": "Harmful and sensitive categories representing the input document.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ClassificationCategory"
      }
    },
    "languageCode": {
      "description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language_code field for more details.",
      "type": "string"
    },
    "languageSupported": {
      "description": "Whether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis.",
      "type": "boolean"
    }
  },
  "$defs": {
    "ClassificationCategory": {
      "type": "object",
      "description": "Represents a category returned from the text classifier.",
      "properties": {
        "confidence": {
          "description": "The classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text.",
          "format": "float",
          "type": "number"
        },
        "name": {
          "description": "The name of the category representing the document.",
          "type": "string"
        },
        "severity": {
          "type": "number",
          "description": "Optional. The classifier's severity of the category. This is only present when the ModerateTextRequest.ModelVersion is set to MODEL_VERSION_2, and the corresponding category has a severity score.",
          "format": "float"
        }
      }
    }
  }
}