{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-inspector/json-schema/amazon-inspector-batch-get-code-snippet-response-schema.json",
  "title": "BatchGetCodeSnippetResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-inspector-codesnippet-api-openapi.yml#/components/schemas/BatchGetCodeSnippetResponse",
  "type": "object",
  "properties": {
    "codeSnippetResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CodeSnippetResult"
      },
      "description": "The retrieved code snippets associated with the provided finding ARNs."
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CodeSnippetError"
      },
      "description": "Any errors Amazon Inspector encountered while trying to retrieve the requested code snippets."
    }
  },
  "$defs": {
    "CodeLine": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "The content of a line of code"
        },
        "lineNumber": {
          "type": "integer",
          "description": "The line number that a section of code is located at."
        }
      },
      "required": [
        "content",
        "lineNumber"
      ]
    },
    "CodeSnippetError": {
      "type": "object",
      "properties": {
        "findingArn": {
          "type": "string",
          "description": "The ARN of the finding that a code snippet couldn't be retrieved for."
        },
        "errorCode": {
          "type": "string",
          "description": "The error code for the error that prevented a code snippet from being retrieved."
        },
        "errorMessage": {
          "type": "string",
          "description": "The error message received when Amazon Inspector failed to retrieve a code snippet."
        }
      },
      "required": [
        "findingArn",
        "errorCode",
        "errorMessage"
      ]
    },
    "CodeSnippetResult": {
      "type": "object",
      "properties": {
        "findingArn": {
          "type": "string",
          "description": "The ARN of a finding that the code snippet is associated with."
        },
        "startLine": {
          "type": "integer",
          "description": "The line number of the first line of a code snippet."
        },
        "endLine": {
          "type": "integer",
          "description": "The line number of the last line of a code snippet."
        },
        "codeSnippet": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CodeLine"
          },
          "description": "Contains information on the retrieved code snippet."
        },
        "suggestedFixes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SuggestedFix"
          },
          "description": "Details of a suggested code fix."
        }
      }
    },
    "SuggestedFix": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "The fix's description."
        },
        "code": {
          "type": "string",
          "description": "The fix's code."
        }
      }
    }
  }
}