Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Reading Order parameter to Computer Vision 3.2 Read Operation #14204

Merged
merged 1 commit into from
May 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
},
{
"$ref": "#/parameters/OcrModelVersion"
},
{
"$ref": "#/parameters/ReadingOrder"
}
],
"consumes": [
Expand Down Expand Up @@ -133,6 +136,12 @@
},
{
"$ref": "#/parameters/Pages"
},
{
"$ref": "#/parameters/OcrModelVersion"
},
{
"$ref": "#/parameters/ReadingOrder"
}
],
"consumes": [
Expand Down Expand Up @@ -594,6 +603,15 @@
"type": "string",
"pattern": "^(latest|\\d{4}-\\d{2}-\\d{2})(-preview)?$",
"default": "latest"
},
"ReadingOrder": {
"name": "readingOrder",
"in": "query",
"description": "Optional parameter to specify which reading order algorithm should be applied when ordering the extract text elements. Can be either 'basic' or 'natural'. Will default to 'basic' if not specified",
"required": false,
"x-ms-parameter-location": "method",
"type": "string",
"default": "basic"
Copy link
Member

@lmazuel lmazuel Apr 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autorest has a complex story with default, so I want to be sure I explain all the design flaws and questionable behavior so there is no surprise:

default : means in Swagger "the server will do that if client doesn't provide the value". It is NOT intended that client put that on the call. However, autorest track1 (the generation you are still using) incorrectly handle this value and will send explicity "readingOrder=basic" by default if it finds default in the Swagger. If this is a problem, and you really care that the default call does not include readingOrder, then I have no other solution today than to ask you to remove default from this Swagger. If you don't care, I would encourage to keep default since this makes the Swagger more accurate.

}
}
}