Skip to content

docs: Document dynamic model fields#709

Draft
marcelomendoncasoares wants to merge 4 commits into
serverpod:mainfrom
marcelomendoncasoares:docs/dynamic-fields
Draft

docs: Document dynamic model fields#709
marcelomendoncasoares wants to merge 4 commits into
serverpod:mainfrom
marcelomendoncasoares:docs/dynamic-fields

Conversation

@marcelomendoncasoares

Copy link
Copy Markdown
Collaborator

Summary

Models, endpoint parameters, and return values support dynamic, but nothing documented it. This adds a page for it and wires it into the places a reader would look first.

Changes

  • Add a "Dynamic fields" page under Models, covering when to reach for dynamic over a typed field, the model file syntax, nullability, the supported value types, endpoint use, JSON and JSONB persistence, copyWith behavior, and the tradeoffs.
  • State that Serverpod carries runtime type metadata in the serialized value, and that the encoded form is an implementation detail.
  • Cover project, module, and shared package model boundaries.
  • Renumber the pages after it in the Models section.
  • Link dynamic from the model type list, the endpoint parameter types, the database data representation section, and the model reference.

Reference

🤖 Generated with Claude Code

The JSONB links pointed at a database/models page that does not exist,
and the Related entry named it in terms the page never introduced. Also
drop the redundant sidebar_label, fold the dynamic note on the tables page
into the sentence it belongs to instead of splitting a paragraph, and flag
serializationDataType before the example that uses it.
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