Menu
Feedback
Known issues
Attachents API doesn't allow null "domainValues" (and it should)
Catalog
ID: 897480
Backlog
Published on9/11/2023
Last updated on9/11/2023
1 min read

Summary

The update requests for the /api/catalog/pvt/attachment/ API isn't allowing updates for the domain Value field as a null value.

This field is nullable, so this API response is incorrectly responding with:

{   "Message": "DomainValues in Domain at position 1 can not be null or empty value" }

Simulation

1 - Create an attachment via UI or API: https://help.vtex.com/pt/tutorial/cadastrar-um-anexo--7zHMUpuoQE4cAskqEUWScU

2 - try updating it sending the domainValue field as a null, for example:

{   "Id": 123,   "Name": "payload with null domain",   "IsRequired": true,   "IsActive": true,   "Domains": [       {           "FieldName": "Basic test",           "MaxCaracters": "354534",           "DomainValues": ""       }   ] }

3 - a "Bad request" response type will be shown to you, when it actually should accept null values for this field.

Workaround

Update the permitted values manually, via UI or create them already null (the POST method is working, the PUT isn't).

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX Community
Join our community
Request VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback