Skip to content

feat: set sane default values for API fields#56

Open
fulviocazzanti wants to merge 1 commit intomainfrom
feat/17-sane-api-defaults
Open

feat: set sane default values for API fields#56
fulviocazzanti wants to merge 1 commit intomainfrom
feat/17-sane-api-defaults

Conversation

@fulviocazzanti
Copy link
Copy Markdown
Contributor

Summary

  • NewCell.State defaults to "initial" when omitted
  • NewCell.StateTimestamp defaults to time.Now().UTC() when omitted
  • Removed required:"true" tags from server-generated fields (Entity.ID, Entity.Version) and from DeployableEntity state fields
  • Added omitempty to NewCell.State and NewCell.StateTimestamp JSON tags

This makes the API easier to use by not requiring clients to provide values that the server can sensibly default.

Closes #17

Test plan

  • TestNewAPICell_Defaults — verifies State defaults to initial and StateTimestamp defaults to now
  • TestNewAPICell_ExplicitValues — verifies explicit values are preserved
  • Full test suite passes

🤖 Generated with Claude Code

Make State and StateTimestamp optional in NewCell and DeployableEntity
DTOs. When omitted, NewAPICell now defaults State to "initial" and
StateTimestamp to the current time (UTC).

Remove required:"true" tags from server-generated fields (Entity.ID,
Entity.Version) since these are always set by the server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

API: set sane default values

1 participant