private Row convertRow(JsonNode node, RowTypeInfo info) {
		final String[] names = info.getFieldNames();
		final TypeInformation<?>[] types = info.getFieldTypes();

		final Row row = new Row(names.length);
		for (int i = 0; i < names.length; i++) {
			final String name = names[i];
			final JsonNode subNode = node.get(name);
			if (subNode == null) {
				if (failOnMissingField) {
					throw new IllegalStateException(
						"Could not find field with name '" + name + "'.");
				} else {
					row.setField(i, null);
				}
			} else {
				row.setField(i, convert(subNode, types[i]));
			}
		}

		return row;
	}
Configures the failure behaviour if a JSON field is missing.

<p>By default, a missing field is ignored and the field is set to null.

@param failOnMissingField Flag indicating whether to fail or not on a missing field.
kafka-base/kafka-base-source/src/main/java/org/apache/flink/formats/json/DTJsonRowDeserializationSchema.java