@sap/cds-compiler 5.9.0 → 5.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@
7
7
  Note: `beta` fixes, changes and features are usually not listed in this ChangeLog but [here](doc/CHANGELOG_BETA.md).
8
8
  The compiler behavior concerning `beta` features can change at any time without notice.
9
9
 
10
+ ## Version 5.9.4 - 2025-05-22
11
+
12
+ - to.edm(x): Parameters are marked optional unless explicitly marked as `not null`.
13
+ Annotation `Core.OptionalParameter` will be added to optional parameters.
14
+
15
+ ## Version 5.9.2 - 2025-04-04
16
+
17
+ ### Fixed
18
+
19
+ - to.edm(x): Revert addition of the attribute sap:filterable="false" to the NavigationProperty DraftAdministrativeData in OData V2
20
+
21
+
10
22
  ## Version 5.9.0 - 2025-03-28
11
23
 
12
24
  ### Added
@@ -479,11 +479,6 @@ function csn2edmAll( _csn, _options, serviceNames, messageFunctions ) {
479
479
  }
480
480
  else {
481
481
  addAssociationV2(np);
482
- // add sap:filterable, if this is DraftAdministrativeData
483
- if (np._csn.name === 'DraftAdministrativeData' &&
484
- (np._csn._parent['@Common.DraftRoot.PreparationAction'] || np._csn._parent['@Common.DraftNode.PreparationAction']) &&
485
- (np._csn._parent.actions && np._csn._parent.actions.draftPrepare))
486
- np._edmAttributes['sap:filterable'] = false;
487
482
  }
488
483
  });
489
484
 
@@ -2152,9 +2152,11 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
2152
2152
  edmUtils.assignAnnotation(p, '@Core.OptionalParameter.DefaultValue', p.default.val);
2153
2153
  optPns.push(p);
2154
2154
  }
2155
- // nullable action params are optional (implicit default null)
2156
- else if (!p.notNull && action.kind === 'action') {
2155
+ // nullable action/function params are optional (implicit default null)
2156
+ else if (!p.notNull) {
2157
2157
  optPns.push(p);
2158
+ if (action.kind === 'function')
2159
+ p['@Core.OptionalParameter'] = { $Type: '' };
2158
2160
  }
2159
2161
  else if (action.kind === 'function') {
2160
2162
  // this is a mandatory parameter, warn about all previously collected optional parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-compiler",
3
- "version": "5.9.0",
3
+ "version": "5.9.4",
4
4
  "description": "CDS (Core Data Services) compiler and backends",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "author": "SAP SE (https://www.sap.com)",