Skip to content

Fix public fields excluded with STJ IncludeFields=true#1907

Merged
lahma merged 1 commit intoRicoSuter:masterfrom
lahma:fix/include-fields-stj-1680
Mar 8, 2026
Merged

Fix public fields excluded with STJ IncludeFields=true#1907
lahma merged 1 commit intoRicoSuter:masterfrom
lahma:fix/include-fields-stj-1680

Conversation

@lahma
Copy link
Copy Markdown
Collaborator

@lahma lahma commented Mar 8, 2026

Summary

Test plan

  • Added test: class with public field + IncludeFields = true → field is in schema
  • Added test: class with public field without IncludeFields → field is NOT in schema
  • Added test: field with [JsonInclude] → field is in schema regardless of IncludeFields
  • All tests pass (459 passed, 7 skipped, 0 failed)

🤖 Generated with Claude Code

@lahma lahma force-pushed the fix/include-fields-stj-1680 branch from 7f09fda to 5d90195 Compare March 8, 2026 17:59
Respect SerializerOptions.IncludeFields and JsonIncludeAttribute when
deciding whether to include fields in schema generation. Previously
fields required DataMemberAttribute regardless of STJ settings.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

Bug: Public Fields not showing up when using System.Text.Json

1 participant