Skip to content

docs: Require nullable for scoped model fields and fix example#681

Merged
developerjamiu merged 1 commit into
mainfrom
docs/fix-serveronly-nullable-scope
Jul 9, 2026
Merged

docs: Require nullable for scoped model fields and fix example#681
developerjamiu merged 1 commit into
mainfrom
docs/fix-serveronly-nullable-scope

Conversation

@developerjamiu

Copy link
Copy Markdown
Contributor

The SelectivelyHiddenClass example on the models page declares a scope=serverOnly field with a non-nullable type, which fails code generation. On a non-serverOnly class, any field with a scope other than all (serverOnly or none) must be nullable — enforced by the model analyzer since Serverpod 1.2.3.

  • Fix the example: hiddenSecretKey: StringString?.
  • Document the rule: a field with a scope other than all must be nullable.

Reported in the docs channel (the published example does not generate). Scoped to the current dev version; the same example exists in the versioned docs and can be backported separately if wanted.

@developerjamiu developerjamiu self-assigned this Jul 9, 2026
@developerjamiu developerjamiu requested a review from Zfinix July 9, 2026 10:31
@developerjamiu developerjamiu added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 9, 2026

@Zfinix Zfinix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this has been in the docs since 2.0 right

@developerjamiu

Copy link
Copy Markdown
Contributor Author

So this has been in the docs since 2.0 right

Yes

@developerjamiu developerjamiu merged commit 3c12500 into main Jul 9, 2026
4 checks passed
@developerjamiu developerjamiu deleted the docs/fix-serveronly-nullable-scope branch July 9, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants