You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 56ace7a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(dts-generator): trust source data for event parameter optionality
Previously, all properties in generated $Xxx$YyyEventParameters interfaces
were unconditionally forced to optional (?), regardless of their actual
"optional" value in the api.json source data.
Now the generator respects each parameter's optional field by default:
- optional: false → required (no ?)
- optional: true or undefined → optional (?)
For events whose parameter optionality has not yet been verified in the
OpenUI5/SAPUI5 sources, a new "eventsWithAllParamsOptional" directive
(string[] in .dtsgenrc) preserves the legacy all-optional behavior.
Format: "fully.qualified.ClassName:eventName"
Changes:
- generate-from-objects.ts: Add eventsWithAllParamsOptional to Directives.
- generate.ts: Initialize the new directive field.
- json-fixer.ts: Pass directives to addEventParameterInterfaces(). Add
"events" to mapLikeProperties so .dtsgenrc overlays can target individual
events by name.
- json-event-parameter-interfaces.ts: Invert buildProperties() to respect
source data by default; only force all-optional when the event is in the
eventsWithAllParamsOptional deny-list. Log a warning when a parameter
has no "optional" value (unexpected edge case).
- Regenerated snapshot .d.ts files (parameters with optional: false now
appear as required).
Needed for #529
0 commit comments