@Test
    public void nonExistingFieldsCanBeIgnoredInPut() throws IOException {
        JsonReader r = createReader("""
                                    {
                                      "put": "id:unittest:smoke::doc1",
                                      "fields": {
                                        "nonexisting1": "ignored value",
                                        "field1": "value1",
                                        "nonexisting2": {
                                          "blocks": {
                                            "a": [2.0, 3.0],
                                            "b": [4.0, 5.0]
                                          }
                                        },
                                        "field2": "value2",
                                        "nonexisting3": {
                                          "cells": [
                                            {
                                              "address": {
                                                "x": "x1"
                                              },
                                              "value": 1.0
                                            }
                                          ]
                                        },
                                        "tensor1": {
                                          "cells": {
                                            "x1": 1.0
                                          }
                                        },
                                        "nonexisting4": "ignored value"
                                      }
                                    }
                                    """);
        DocumentParseInfo parseInfo = r.parseDocument().get();
        DocumentType docType = r.readDocumentType(parseInfo.documentId);
        DocumentPut put = new DocumentPut(new Document(docType, parseInfo.documentId));
        boolean fullyApplied = new VespaJsonDocumentReader(true).readPut(parseInfo.fieldsBuffer, put);
        assertFalse(fullyApplied);
        assertNull(put.getDocument().getField("nonexisting1"));
        assertEquals("value1", put.getDocument().getFieldValue("field1").toString());
        assertNull(put.getDocument().getField("nonexisting2"));
        assertEquals("value2", put.getDocument().getFieldValue("field2").toString());
        assertNull(put.getDocument().getField("nonexisting3"));
        assertEquals(Tensor.from("tensor(x{}):{{x:x1}:1.0}"), put.getDocument().getFieldValue("tensor1").getWrappedValue());
        assertNull(put.getDocument().getField("nonexisting4"));
    }
Basic test of JSON streams to Vespa document instances.

@author Steinar Knutsen
@author bratseth
document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java