File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
src/main/java/com/saasquatch/jsonschemainferrer Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 2525import com .fasterxml .jackson .databind .node .JsonNodeType ;
2626import com .fasterxml .jackson .databind .node .ObjectNode ;
2727import com .fasterxml .jackson .databind .node .ValueNode ;
28+ import com .saasquatch .jsonschemainferrer .annotations .VisibleForTesting ;
2829
2930/**
3031 * Infer JSON schema based on sample JSONs. This class is immutable and thread safe.
@@ -332,8 +333,8 @@ private void postProcessAnyOfs(@Nonnull Collection<ObjectNode> anyOfs) {
332333 anyOfs .add (combinedSimpleAnyOf );
333334 }
334335
335- // Visible for testing
336336 @ Nonnull
337+ @ VisibleForTesting
337338 String inferPrimitiveType (@ Nonnull JsonNode sample , boolean allNumbersAreIntegers ) {
338339 // Marker for whether the error is caused by a known type
339340 final JsonNodeType type = sample .getNodeType ();
Original file line number Diff line number Diff line change 1+ package com .saasquatch .jsonschemainferrer .annotations ;
2+
3+ import java .lang .annotation .Retention ;
4+ import java .lang .annotation .RetentionPolicy ;
5+
6+ /**
7+ * Indicates that an element is only visible for testing.
8+ *
9+ * @author sli
10+ */
11+ @ Retention (RetentionPolicy .SOURCE ) // Only used for documentation
12+ public @interface VisibleForTesting {
13+
14+ }
You can’t perform that action at this time.
0 commit comments