-
Notifications
You must be signed in to change notification settings - Fork 2
include all fields by default #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@proofkit/better-auth
@proofkit/cli
create-proofkit
@proofkit/fmdapi
@proofkit/fmodata
@proofkit/typegen
@proofkit/webviewer
commit: |
6a2c2bf to
edecb0a
Compare
| allTablesConfig, | ||
| setValue, | ||
| fieldsData, | ||
| topLevelIncludeAllFieldsByDefault, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excludeAllFields not updated for new include-by-default setting
The includeAllFields function was updated to conditionally handle the effectiveIncludeAllFieldsByDefault setting with two branches of logic (one for true, one for false), but the excludeAllFields function was not similarly updated. When includeAllFieldsByDefault is false, fields not in the config array are already excluded by default, so the correct "exclude all" behavior would be to clear the fields array. Instead, excludeAllFields always adds every field with exclude: true, creating redundant config entries. Additionally, the dependency array is missing topLevelIncludeAllFieldsByDefault.
| const fieldConfig = Array.isArray(fieldsConfig) | ||
| ? fieldsConfig.find((f) => f?.fieldName === fieldName) | ||
| : undefined; | ||
| const isExcluded = fieldConfig?.exclude === true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setFieldTypeOverride doesn't preserve field when clearing override
The setFieldTypeOverride function wasn't updated to account for includeAllFieldsByDefault. When removing a typeOverride and only fieldName remains, the code removes the entire field entry (lines 466-496). However, when includeAllFieldsByDefault is false, removing the field entry causes the field to become excluded, since fields not in the config array are excluded by default. This means clearing a type override unintentionally excludes the field. The function needs to preserve the field entry when includeAllFieldsByDefault is false, and its dependency array is also missing topLevelIncludeAllFieldsByDefault.
c8be2f8 to
e04e52a
Compare

Note
Introduces configurable field-inclusion behavior for OData generation.
includeAllFieldsByDefaulttoFmodataConfigand table configs intypes.ts(defaulttrue)generateODataTypes.tspropagates and respectsincludeAllFieldsByDefault; whenfalse, only fields explicitly listed intableOverride.fieldsare generatedincludeAllFieldsByDefaulttotrueand exposes a switch to toggle itWritten by Cursor Bugbot for commit e04e52a. This will update automatically on new commits. Configure here.