Skip to content

Commit 1eb1eb1

Browse files
committed
🐛 fix for missing data_schema property
1 parent 5e427d7 commit 1eb1eb1

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.mindee.parsing.v2;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import lombok.EqualsAndHashCode;
6+
7+
/**
8+
* Data schema options activated during the inference.
9+
*/
10+
@EqualsAndHashCode
11+
@JsonIgnoreProperties(ignoreUnknown = true)
12+
public class DataSchemaActiveOptions {
13+
14+
@JsonProperty("override")
15+
private boolean override;
16+
17+
/**
18+
* Whether a data schema override was provided for the inference.
19+
*/
20+
public boolean getOverride() {
21+
return override;
22+
}
23+
}

src/main/java/com/mindee/parsing/v2/InferenceActiveOptions.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
import static com.mindee.parsing.SummaryHelper.formatForDisplay;
44

5+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
56
import com.fasterxml.jackson.annotation.JsonProperty;
67
import java.util.StringJoiner;
8+
import lombok.EqualsAndHashCode;
9+
import lombok.Getter;
710

811
/**
912
* Option response for V2 API inference.
1013
*/
14+
@EqualsAndHashCode
15+
@JsonIgnoreProperties(ignoreUnknown = true)
1116
public final class InferenceActiveOptions {
1217

1318
@JsonProperty("rag")
@@ -22,6 +27,13 @@ public final class InferenceActiveOptions {
2227
@JsonProperty("confidence")
2328
private boolean confidence;
2429

30+
/**
31+
* Data schema options provided for the inference.
32+
*/
33+
@Getter
34+
@JsonProperty("data_schema")
35+
private DataSchemaActiveOptions dataSchema;
36+
2537
/**
2638
* Whether the RAG feature was activated.
2739
*/

src/test/java/com/mindee/parsing/v2/InferenceTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ void rawTexts_mustBeAccessible() throws IOException {
466466
assertTrue(activeOptions.getRawText());
467467
assertFalse(activeOptions.getPolygon());
468468
assertFalse(activeOptions.getConfidence());
469+
assertFalse(activeOptions.getDataSchema().getOverride());
469470

470471
assertNull(inference.getResult().getRag());
471472

0 commit comments

Comments
 (0)