|
20 | 20 |
|
21 | 21 | package com.arangodb.internal.velocypack;
|
22 | 22 |
|
23 |
| -import com.arangodb.entity.*; |
24 |
| -import com.arangodb.entity.arangosearch.*; |
| 23 | +import com.arangodb.entity.BaseDocument; |
| 24 | +import com.arangodb.entity.BaseEdgeDocument; |
| 25 | +import com.arangodb.entity.CollectionType; |
| 26 | +import com.arangodb.entity.DocumentField; |
| 27 | +import com.arangodb.entity.LogLevel; |
| 28 | +import com.arangodb.entity.MinReplicationFactor; |
| 29 | +import com.arangodb.entity.Permissions; |
| 30 | +import com.arangodb.entity.ReplicationFactor; |
| 31 | +import com.arangodb.entity.ViewType; |
| 32 | +import com.arangodb.entity.arangosearch.ArangoSearchCompression; |
| 33 | +import com.arangodb.entity.arangosearch.ArangoSearchProperties; |
| 34 | +import com.arangodb.entity.arangosearch.CollectionLink; |
| 35 | +import com.arangodb.entity.arangosearch.ConsolidationType; |
| 36 | +import com.arangodb.entity.arangosearch.FieldLink; |
| 37 | +import com.arangodb.entity.arangosearch.PrimarySort; |
| 38 | +import com.arangodb.entity.arangosearch.StoreValuesType; |
| 39 | +import com.arangodb.entity.arangosearch.StoredValue; |
25 | 40 | import com.arangodb.internal.velocystream.internal.AuthenticationRequest;
|
26 | 41 | import com.arangodb.model.CollectionSchema;
|
27 | 42 | import com.arangodb.model.TraversalOptions;
|
28 | 43 | import com.arangodb.model.TraversalOptions.Order;
|
29 | 44 | import com.arangodb.model.arangosearch.ArangoSearchPropertiesOptions;
|
30 |
| -import com.arangodb.velocypack.*; |
| 45 | +import com.arangodb.velocypack.VPackBuilder; |
| 46 | +import com.arangodb.velocypack.VPackParser; |
| 47 | +import com.arangodb.velocypack.VPackSerializer; |
| 48 | +import com.arangodb.velocypack.VPackSlice; |
| 49 | +import com.arangodb.velocypack.ValueType; |
31 | 50 | import com.arangodb.velocystream.Request;
|
32 | 51 |
|
33 | 52 | import java.util.Collection;
|
@@ -247,10 +266,10 @@ private static void serializeFieldLinks(final VPackBuilder builder, final Collec
|
247 | 266 |
|
248 | 267 | public static final VPackSerializer<CollectionSchema> COLLECTION_VALIDATION = (builder, attribute, value, context) -> {
|
249 | 268 | VPackParser parser = new VPackParser.Builder().build();
|
250 |
| - VPackSlice rule = parser.fromJson(value.getRule(), true); |
| 269 | + VPackSlice rule = value.getRule() != null ? parser.fromJson(value.getRule(), true) : null; |
251 | 270 | final Map<String, Object> doc = new HashMap<>();
|
252 | 271 | doc.put("message", value.getMessage());
|
253 |
| - doc.put("level", value.getLevel().getValue()); |
| 272 | + doc.put("level", value.getLevel() != null ? value.getLevel().getValue() : null); |
254 | 273 | doc.put("rule", rule);
|
255 | 274 | context.serialize(builder, attribute, doc);
|
256 | 275 | };
|
|
0 commit comments