databricks-sdk-go icon indicating copy to clipboard operation
databricks-sdk-go copied to clipboard

[ISSUE] The `content` field in `workspace.Import` structure is marked as optional, leading to inability to import empty files

Open alexott opened this issue 1 year ago • 3 comments

Description

The content field is marked as optional, so Terraform provider isn't able to create empty files, such as, __init__.py.

Expected behavior

I should be able to create empty files in the workspace

alexott avatar Nov 17 '23 10:11 alexott

Thanks for raising this. Seems like a bug in the OpenAPI spec for this service. Will follow-up with the respective team.

mgyucht avatar Nov 20 '23 10:11 mgyucht

@alexott is it possible to set ForceSendFields: "Content"? That should ensure that that field is serialized, even if content is an empty string.

mgyucht avatar Jan 03 '24 10:01 mgyucht

Yes, I did it in TF that way, but we'll need to handle it in SDKs as well - I'm not sure why content is marked as optional

alexott avatar Jan 03 '24 10:01 alexott