-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[formrecognizer] model_id param validation #11569
[formrecognizer] model_id param validation #11569
Conversation
@maririos FYI since we talked about this |
ohh interesting. FYI @samvaity as she was looking into consistency across languages for this item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, but also waiting to hear what @samvaity thinks about guid validation
I think we should validate if it is a valid UUID. Especially since the service does not validate that eagerly and will result in a request failure. |
@@ -277,6 +277,9 @@ def begin_recognize_custom_forms(self, model_id, form, **kwargs): | |||
:caption: Recognize fields and values from a custom form. | |||
""" | |||
|
|||
if not model_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious - don't we have match conditions for delete operations in form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show me where you see that?
I talked to Johan about this and posted the reasoning above: Reasoning is that service could eventually allow users to name their models with "real" names and not just server generated guids. It's reasonable to check for None/empty string since this will likely never be a valid model_id and prevents a 404 error in the path URL. |
Not sure how other languages are handling this currently, but Java will always first convert the user-provided string to a UUID, using |
But if the service eventually allows the user to name the model, e.g. "myInvoiceModel", won't this fail with |
To allow this, the service will probably have to start accepting Strings in their API's and that's when we (Java) can plan to remove the |
…into models_to_submodels * 'master' of https://github.com/Azure/azure-sdk-for-python: [text analytics] merging feature branch into master (Azure#11632) regen swagger and make list_indexes pageable (Azure#11635) Sync eng/common directory with azure-sdk-tools repository (Azure#11566) Rename to completed_on and requested_on in the CustomFormModel (Azure#11592) [formrecognizer] model_id param validation (Azure#11569) [Batch] Fix issue in latest REST API (Azure#11604)
Item on arch board issues #11283
Original suggestion was to to enforce that user passes guid for methods that accept
model_id
parameter. Based on architect guidance we will not validate for this, but will validate that model_id is not None or an empty string.Reasoning is that service could eventually allow users to name their models with "real" names and not just server generated guids. It's reasonable to check for None/empty string since this will likely never be a valid model_id and prevents a 404 error in the path URL.