Skip to content

Commit 5522b9d

Browse files
reverting the changes (#72)
1 parent c99b72a commit 5522b9d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55
The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

7+
## Version 1.2.2 - tbd
8+
9+
### Fixed
10+
11+
- Properties with `@mandatory` annotation is now added to `required` array.
12+
713
## Version 1.2.1 - 11.03.2025
814

915
### Changed

lib/compile/csdl2openapi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
20342034
Object.keys(properties).forEach(iName => {
20352035
const property = properties[iName];
20362036
if (suffix === SUFFIX.read) schemaProperties[iName] = getSchema(property);
2037+
if ((Object.prototype.hasOwnProperty.call(property, '@Common.FieldControl')) && property['@Common.FieldControl'] === 'Mandatory') { required.push(iName) }
20372038
if (property.$Kind == 'NavigationProperty') {
20382039
if (property.$Collection && suffix === "" && isCount === true) {
20392040
schemaProperties[`${iName}@${csdl.$Version === '4.0' ? 'odata.' : ''}count`] = ref('count');

0 commit comments

Comments
 (0)