Skip to content
New issue

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

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

Already on GitHub? # to your account

invalid value for "locale" #2

Closed
nglelinh opened this issue Feb 7, 2023 · 1 comment
Closed

invalid value for "locale" #2

nglelinh opened this issue Feb 7, 2023 · 1 comment

Comments

@nglelinh
Copy link

nglelinh commented Feb 7, 2023

I am trying to use the search product API, but getting the following error

InvalidArgumentException  : invalid value for "locale" when calling ProductSearchV20200826Api.productsRequest, must conform to the pattern /^[-_]+$/.

The locale value in example en_US can not pass validation in

if (!preg_match("/^[-_]+$/", $locale)) {

Please help to explain why do we have such validation ? and which value should I submit to go through this checking ?

@jlevers
Copy link
Contributor

jlevers commented Mar 14, 2023

Sorry, this took me quite a while to get around to.

Those regexes were there because they're included in the Amazon OpenAPI models for this API, but I agree that they're incorrect. They've been removed in v1.0.3.

@jlevers jlevers closed this as completed Mar 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants