{"record":{"id":"33f452102111b6f7","repo":"apache/beam","slug":"unsupported-field-type-in-field","errorCode":null,"errorMessage":"Unsupported field type {} in field {}","messagePattern":"Unsupported field type (.+?) in field (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/JsonUtils.java","lineNumber":274,"sourceCode":"      if (((ArraySchema) propertySchema).getAllItemSchema() == null) {\n        throw new IllegalArgumentException(\n            \"Tuple-like arrays are unsupported. Expected a single item type for field \"\n                + propertyName);\n      }\n      beamSchemaBuilder =\n          beamSchemaBuilder.addField(\n              fieldConstructor.apply(\n                  propertyName,\n                  Schema.FieldType.array(\n                      beamTypeFromJsonSchemaType(\n                          ((ArraySchema) propertySchema).getAllItemSchema()))));\n    } else {\n      try {\n        beamSchemaBuilder =\n            beamSchemaBuilder.addField(\n                fieldConstructor.apply(propertyName, beamTypeFromJsonSchemaType(propertySchema)));\n      } catch (IllegalArgumentException e) {\n        throw new IllegalArgumentException(\n            \"Unsupported field type \" + propertySchema.getClass() + \" in field \" + propertyName, e);\n      }\n    }\n    return beamSchemaBuilder;\n  }\n\n  private static Schema.FieldType beamTypeFromJsonSchemaType(\n      org.everit.json.schema.Schema propertySchema) {\n    if (propertySchema instanceof org.everit.json.schema.ObjectSchema) {\n      return Schema.FieldType.row(beamSchemaFromJsonSchema((ObjectSchema) propertySchema));\n    } else if (propertySchema instanceof org.everit.json.schema.BooleanSchema) {\n      return Schema.FieldType.BOOLEAN;\n    } else if (propertySchema instanceof org.everit.json.schema.NumberSchema) {\n      return ((NumberSchema) propertySchema).requiresInteger()\n          ? Schema.FieldType.INT64\n          : Schema.FieldType.DOUBLE;\n    } else if (propertySchema instanceof org.everit.json.schema.StringSchema) {\n      return Schema.FieldType.STRING;","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/JsonUtils.java#L256-L292","documentation":"In JsonUtils.addPropertySchemaToBeamSchema, when a JSON Schema property is not an array/object/reference type, the code tries to map it with beamTypeFromJsonSchemaType; if that mapping throws IllegalArgumentException, this wrapper is thrown naming the property's Java class and field name. It means the JSON Schema property uses a type Beam cannot translate.","triggerScenarios":"Calling JsonUtils.fromJsonSchema/beamSchemaFromJsonSchema with a property whose schema class is unsupported (e.g. CombinedSchema, NotSchema, or an exotic everit schema type) instead of simple types, references, arrays, or object schemas.","commonSituations":"JSON Schemas using anyOf/oneOf/allOf combined constraints on a field; $ref plus inline constraints producing CombinedSchema; enums or format-only schemas the mapper doesn't recognize.","solutions":["Simplify the property's JSON Schema to a single plain type (string/number/boolean/object/array) or a $ref","Unwrap anyOf/oneOf into a concrete type before passing to Beam","Extend beamTypeFromJsonSchemaType to handle the unsupported schema class","Inspect the chained cause to see which inner type mapping failed"],"exampleFix":"// before\n{\"a\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"integer\"}]}}\n// after\n{\"a\":{\"type\":\"string\"}}","handlingStrategy":"validation","validationCode":"static boolean isSimpleOrRefOrContainer(org.everit.json.schema.Schema s) {\n  return s instanceof org.everit.json.schema.StringSchema\n      || s instanceof org.everit.json.schema.NumberSchema\n      || s instanceof org.everit.json.schema.BooleanSchema\n      || s instanceof org.everit.json.schema.ObjectSchema\n      || s instanceof org.everit.json.schema.ArraySchema\n      || s instanceof org.everit.json.schema.ReferenceSchema;\n}","typeGuard":"static boolean beamMappableProperty(org.everit.json.schema.Schema s) {\n  return isSimpleOrRefOrContainer(s) && !(s instanceof org.everit.json.schema.CombinedSchema);\n}","tryCatchPattern":"try {\n  Schema s = JsonUtils.beamSchemaFromJsonSchema(jsonSchema);\n} catch (IllegalArgumentException e) {\n  if (e.getCause() instanceof IllegalArgumentException) {\n    throw new SchemaParseException(\"Unsupported field type: \" + e.getCause().getMessage(), e);\n  }\n  throw e;\n}","preventionTips":["Avoid anyOf/oneOf/allOf (CombinedSchema) on properties destined for Beam","Prefer plain types or $ref with a plain target schema","Test every schema against beamSchemaFromJsonSchema before production use"],"tags":["java","json-schema","schemas","type-conversion"],"backgroundTag":"schema-validation-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}