Skip to content

Commit

Permalink
[formrecognizer] valueObject and valueArray are optional even if valu…
Browse files Browse the repository at this point in the history
…e_type is returned (#19140)

* valueObject and valueArray are optional even if value_type is returned

* update readme/changelog
  • Loading branch information
kristapratico authored Jun 8, 2021
1 parent f880fa2 commit 29fc09a
Show file tree
Hide file tree
Showing 6 changed files with 570 additions and 4 deletions.
5 changes: 4 additions & 1 deletion sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Release History

## 3.1.1 (Unreleased)
## 3.1.1 (2021-06-08)

**Bug Fixes**

- Handles invoices that do not have sub-line item fields detected.

## 3.1.0 (2021-05-26)

Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/azure-ai-formrecognizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This table shows the relationship between SDK versions and supported API version

|SDK version|Supported API version of service
|-|-
|3.1.0 - Latest GA release| 2.0, 2.1 (default)
|3.1.X - Latest GA release| 2.0, 2.1 (default)
|3.0.0| 2.0

#### Create a Form Recognizer resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def get_field_value(
return [
FormField._from_generated(field, value, read_result)
for value in value.value_array
]
] if value.value_array else []
if value.type == "object":
return {
key: FormField._from_generated(key, value, read_result)
for key, value in value.value_object.items()
}
} if value.value_object else {}
if value.type == "selectionMark":
return value.value_selection_mark
if value.type == "countryRegion":
Expand Down
Loading

0 comments on commit 29fc09a

Please sign in to comment.