Skip to content

fix(servercluster): add omitempty to IDName.Name and make VPC optional - #44

Open
GerryRicloud wants to merge 1 commit into
netrisai:v4.14.0from
GerryRicloud:omitempty-idname-name
Open

fix(servercluster): add omitempty to IDName.Name and make VPC optional#44
GerryRicloud wants to merge 1 commit into
netrisai:v4.14.0from
GerryRicloud:omitempty-idname-name

Conversation

@GerryRicloud

Copy link
Copy Markdown

The IDName struct always serialized Name as "" when not set, causing "undefined (string) is required" errors from the Netris API. The API accepts ID-only references (matching the REST behavior where only the id field is sent).

  • IDName.Name: omitempty — omit empty names from JSON
  • Servers.Name/Shared: omitempty — same for server references
  • ServerClusterW.VPC: pointer + omitempty — omit VPC entirely when not set, allowing the API to auto-create one per cluster

IDName.Name always serialized as "name":"" when not set, causing API
rejection. Make VPC a pointer (*IDName) with omitempty so it can be
fully omitted when not needed.

Signed-off-by: Gerry Yang <gerry@ricloud.ai>
@GerryRicloud
GerryRicloud force-pushed the omitempty-idname-name branch from 4281ff4 to 4bb0747 Compare August 4, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant