Skip to content

Commit 4d55cb0

Browse files
committed
#9 fix 'can`t deserialize 8,9 result type'
1 parent 389ec07 commit 4d55cb0

File tree

9 files changed

+39
-36
lines changed

9 files changed

+39
-36
lines changed

client/.openapi-generator/FILES

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ src/main/generated/com/regula/documentreader/webclient/model/DetailsOptical.java
2222
src/main/generated/com/regula/documentreader/webclient/model/DetailsRFID.java
2323
src/main/generated/com/regula/documentreader/webclient/model/DocVisualExtendedField.java
2424
src/main/generated/com/regula/documentreader/webclient/model/DocumentImageResult.java
25-
src/main/generated/com/regula/documentreader/webclient/model/DocumentType.java
2625
src/main/generated/com/regula/documentreader/webclient/model/DocumentTypesCandidatesList.java
2726
src/main/generated/com/regula/documentreader/webclient/model/DocumentTypesCandidatesResult.java
27+
src/main/generated/com/regula/documentreader/webclient/model/FDSIDList.java
2828
src/main/generated/com/regula/documentreader/webclient/model/GraphicField.java
2929
src/main/generated/com/regula/documentreader/webclient/model/GraphicFieldsList.java
3030
src/main/generated/com/regula/documentreader/webclient/model/GraphicsResult.java
@@ -51,7 +51,6 @@ src/main/generated/com/regula/documentreader/webclient/model/StatusResult.java
5151
src/main/generated/com/regula/documentreader/webclient/model/StringRecognitionResult.java
5252
src/main/generated/com/regula/documentreader/webclient/model/SymbolCandidate.java
5353
src/main/generated/com/regula/documentreader/webclient/model/SymbolRecognitionResult.java
54-
src/main/generated/com/regula/documentreader/webclient/model/TFDSIDList.java
5554
src/main/generated/com/regula/documentreader/webclient/model/TextAvailableSource.java
5655
src/main/generated/com/regula/documentreader/webclient/model/TextDataResult.java
5756
src/main/generated/com/regula/documentreader/webclient/model/TextField.java

client/src/main/generated/com/regula/documentreader/webclient/ApiClient.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,10 @@ public void onResponse(Call call, Response response) throws IOException {
940940
} catch (ApiException e) {
941941
callback.onFailure(e, response.code(), response.headers().toMultimap());
942942
return;
943+
} catch (Exception e) {
944+
callback.onFailure(
945+
new ApiException(e), response.code(), response.headers().toMultimap());
946+
return;
943947
}
944948
callback.onSuccess(result, response.code(), response.headers().toMultimap());
945949
}

client/src/main/generated/com/regula/documentreader/webclient/model/TFDSIDList.java renamed to client/src/main/generated/com/regula/documentreader/webclient/model/FDSIDList.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.Objects;
1919

2020
/** Extended document type info and Regula's 'Information Reference Systems' links */
21-
public class TFDSIDList {
21+
public class FDSIDList {
2222
public static final String SERIALIZED_NAME_I_C_A_O = "ICAO";
2323

2424
@SerializedName(SERIALIZED_NAME_I_C_A_O)
@@ -32,7 +32,7 @@ public class TFDSIDList {
3232
public static final String SERIALIZED_NAME_D_TYPE = "dType";
3333

3434
@SerializedName(SERIALIZED_NAME_D_TYPE)
35-
private DocumentType dType;
35+
private int dType;
3636

3737
public static final String SERIALIZED_NAME_D_FORMAT = "dFormat";
3838

@@ -69,7 +69,7 @@ public class TFDSIDList {
6969
@SerializedName(SERIALIZED_NAME_D_STATE_NAME)
7070
private String dStateName;
7171

72-
public TFDSIDList withICAO(String ICAO) {
72+
public FDSIDList withICAO(String ICAO) {
7373
this.ICAO = ICAO;
7474
return this;
7575
}
@@ -88,12 +88,12 @@ public void setICAO(String ICAO) {
8888
this.ICAO = ICAO;
8989
}
9090

91-
public TFDSIDList withList(List<Integer> list) {
91+
public FDSIDList withList(List<Integer> list) {
9292
this.list = list;
9393
return this;
9494
}
9595

96-
public TFDSIDList addListItem(int listItem) {
96+
public FDSIDList addListItem(int listItem) {
9797
if (this.list == null) {
9898
this.list = new ArrayList<Integer>();
9999
}
@@ -115,7 +115,7 @@ public void setList(List<Integer> list) {
115115
this.list = list;
116116
}
117117

118-
public TFDSIDList withDType(DocumentType dType) {
118+
public FDSIDList withDType(int dType) {
119119
this.dType = dType;
120120
return this;
121121
}
@@ -126,15 +126,15 @@ public TFDSIDList withDType(DocumentType dType) {
126126
* @return dType
127127
*/
128128
@javax.annotation.Nullable
129-
public DocumentType getdType() {
129+
public int getdType() {
130130
return dType;
131131
}
132132

133-
public void setdType(DocumentType dType) {
133+
public void setdType(int dType) {
134134
this.dType = dType;
135135
}
136136

137-
public TFDSIDList withDFormat(int dFormat) {
137+
public FDSIDList withDFormat(int dFormat) {
138138
this.dFormat = dFormat;
139139
return this;
140140
}
@@ -153,7 +153,7 @@ public void setdFormat(int dFormat) {
153153
this.dFormat = dFormat;
154154
}
155155

156-
public TFDSIDList withDMRZ(Boolean dMRZ) {
156+
public FDSIDList withDMRZ(Boolean dMRZ) {
157157
this.dMRZ = dMRZ;
158158
return this;
159159
}
@@ -172,7 +172,7 @@ public void setdMRZ(Boolean dMRZ) {
172172
this.dMRZ = dMRZ;
173173
}
174174

175-
public TFDSIDList withDDescription(String dDescription) {
175+
public FDSIDList withDDescription(String dDescription) {
176176
this.dDescription = dDescription;
177177
return this;
178178
}
@@ -191,7 +191,7 @@ public void setdDescription(String dDescription) {
191191
this.dDescription = dDescription;
192192
}
193193

194-
public TFDSIDList withDYear(String dYear) {
194+
public FDSIDList withDYear(String dYear) {
195195
this.dYear = dYear;
196196
return this;
197197
}
@@ -210,7 +210,7 @@ public void setdYear(String dYear) {
210210
this.dYear = dYear;
211211
}
212212

213-
public TFDSIDList withDCountryName(String dCountryName) {
213+
public FDSIDList withDCountryName(String dCountryName) {
214214
this.dCountryName = dCountryName;
215215
return this;
216216
}
@@ -229,7 +229,7 @@ public void setdCountryName(String dCountryName) {
229229
this.dCountryName = dCountryName;
230230
}
231231

232-
public TFDSIDList withDStateCode(String dStateCode) {
232+
public FDSIDList withDStateCode(String dStateCode) {
233233
this.dStateCode = dStateCode;
234234
return this;
235235
}
@@ -248,7 +248,7 @@ public void setdStateCode(String dStateCode) {
248248
this.dStateCode = dStateCode;
249249
}
250250

251-
public TFDSIDList withDStateName(String dStateName) {
251+
public FDSIDList withDStateName(String dStateName) {
252252
this.dStateName = dStateName;
253253
return this;
254254
}
@@ -275,17 +275,17 @@ public boolean equals(java.lang.Object o) {
275275
if (o == null || getClass() != o.getClass()) {
276276
return false;
277277
}
278-
TFDSIDList tfDSIDList = (TFDSIDList) o;
279-
return Objects.equals(this.ICAO, tfDSIDList.ICAO)
280-
&& Objects.equals(this.list, tfDSIDList.list)
281-
&& Objects.equals(this.dType, tfDSIDList.dType)
282-
&& Objects.equals(this.dFormat, tfDSIDList.dFormat)
283-
&& Objects.equals(this.dMRZ, tfDSIDList.dMRZ)
284-
&& Objects.equals(this.dDescription, tfDSIDList.dDescription)
285-
&& Objects.equals(this.dYear, tfDSIDList.dYear)
286-
&& Objects.equals(this.dCountryName, tfDSIDList.dCountryName)
287-
&& Objects.equals(this.dStateCode, tfDSIDList.dStateCode)
288-
&& Objects.equals(this.dStateName, tfDSIDList.dStateName);
278+
FDSIDList fdSIDList = (FDSIDList) o;
279+
return Objects.equals(this.ICAO, fdSIDList.ICAO)
280+
&& Objects.equals(this.list, fdSIDList.list)
281+
&& Objects.equals(this.dType, fdSIDList.dType)
282+
&& Objects.equals(this.dFormat, fdSIDList.dFormat)
283+
&& Objects.equals(this.dMRZ, fdSIDList.dMRZ)
284+
&& Objects.equals(this.dDescription, fdSIDList.dDescription)
285+
&& Objects.equals(this.dYear, fdSIDList.dYear)
286+
&& Objects.equals(this.dCountryName, fdSIDList.dCountryName)
287+
&& Objects.equals(this.dStateCode, fdSIDList.dStateCode)
288+
&& Objects.equals(this.dStateName, fdSIDList.dStateName);
289289
}
290290

291291
@Override
@@ -306,7 +306,7 @@ public int hashCode() {
306306
@Override
307307
public String toString() {
308308
StringBuilder sb = new StringBuilder();
309-
sb.append("class TFDSIDList {\n");
309+
sb.append("class FDSIDList {\n");
310310
sb.append(" ICAO: ").append(toIndentedString(ICAO)).append("\n");
311311
sb.append(" list: ").append(toIndentedString(list)).append("\n");
312312
sb.append(" dType: ").append(toIndentedString(dType)).append("\n");

client/src/main/generated/com/regula/documentreader/webclient/model/GraphicFieldType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class GraphicFieldType {
3535
/**
3636
* Cropped and rotated with perspective compensation (front side) of a document. Single input
3737
* image can contain multiple document side/pages, which will be returned as separated results.
38-
* Most coordinates in other types defined on that images.
38+
* Most coordinates in other types defined on that image.
3939
*/
4040
public static final int DOCUMENT_FRONT = 207;
4141

client/src/main/generated/com/regula/documentreader/webclient/model/OneCandidate.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class OneCandidate {
4141
public static final String SERIALIZED_NAME_FD_S_I_D_LIST = "FDSIDList";
4242

4343
@SerializedName(SERIALIZED_NAME_FD_S_I_D_LIST)
44-
private TFDSIDList fdSIDList;
44+
private FDSIDList fdSIDList;
4545

4646
public static final String SERIALIZED_NAME_NECESSARY_LIGHTS = "NecessaryLights";
4747

@@ -141,7 +141,7 @@ public void setRfIDPresence(int rfIDPresence) {
141141
this.rfIDPresence = rfIDPresence;
142142
}
143143

144-
public OneCandidate withFdSIDList(TFDSIDList fdSIDList) {
144+
public OneCandidate withFdSIDList(FDSIDList fdSIDList) {
145145
this.fdSIDList = fdSIDList;
146146
return this;
147147
}
@@ -152,11 +152,11 @@ public OneCandidate withFdSIDList(TFDSIDList fdSIDList) {
152152
* @return fdSIDList
153153
*/
154154
@javax.annotation.Nullable
155-
public TFDSIDList getFdSIDList() {
155+
public FDSIDList getFdSIDList() {
156156
return fdSIDList;
157157
}
158158

159-
public void setFdSIDList(TFDSIDList fdSIDList) {
159+
public void setFdSIDList(FDSIDList fdSIDList) {
160160
this.fdSIDList = fdSIDList;
161161
}
162162

client/src/main/generated/com/regula/documentreader/webclient/model/RawImageResult.java

100644100755
File mode changed.

dev.md

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Then use next command from the project root.
2525
ENUM_MAPPINGS="TextFieldType=Integer,GraphicFieldType=Integer,Scenario=String,DocumentFormat=Integer,\
2626
Light=Integer,Result=Integer,VerificationResult=Integer,RfidLocation=Integer,\
2727
DocumentTypeRecognitionResult=Integer,ProcessingStatus=Integer,Source=String,CheckResult=Integer,\
28-
LCID=Integer" \
28+
LCID=Integer,DocumentType=Integer" \
2929
\
3030
&& docker run --rm -v "${PWD}:/client" -v "${DEFINITION_FOLDER}:/definitions" \
3131
openapitools/openapi-generator-cli generate \

example/README.md

100644100755
File mode changed.

example/src/main/java/com/regula/documentreader/webclient/example/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static void main(String[] args) throws IOException, ApiException {
4040

4141
var requestParams = new RecognitionParams()
4242
.withScenario(Scenario.FULL_PROCESS)
43-
.withResultTypeOutput(Result.STATUS, Result.TEXT, Result.IMAGES);
43+
.withResultTypeOutput(Result.STATUS, Result.TEXT, Result.IMAGES, Result.DOCUMENT_TYPE);
4444

4545
RecognitionRequest request = new RecognitionRequest(requestParams, List.of(image));
4646

0 commit comments

Comments
 (0)