{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-appsync/json-schema/amazon-appsync-evaluate-code-request-schema.json",
  "title": "EvaluateCodeRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-appsync-operations-api-openapi.yml#/components/schemas/EvaluateCodeRequest",
  "type": "object",
  "properties": {
    "runtime": {
      "$ref": "#/$defs/AppSyncRuntime"
    },
    "code": {
      "type": "string",
      "description": "The code definition to be evaluated. Note that code and runtime are both required for this action. The runtime value must be APPSYNC_JS."
    },
    "context": {
      "type": "string",
      "description": "The map that holds all of the contextual information for your resolver invocation. A context is required for this action."
    },
    "function": {
      "type": "string",
      "description": "The function within the code to be evaluated. If provided, the valid values are request and response."
    }
  },
  "required": [
    "runtime",
    "code",
    "context"
  ],
  "$defs": {
    "AppSyncRuntime": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "APPSYNC_JS"
          ],
          "description": "The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS."
        },
        "runtimeVersion": {
          "type": "string",
          "description": "The version of the runtime to use. Currently, the only allowed version is 1.0.0."
        }
      },
      "required": [
        "name",
        "runtimeVersion"
      ]
    }
  }
}