Skip to content

Commit

Permalink
Same for csdl2openapi.js
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Jan 24, 2025
1 parent a91a17f commit 3aa3479
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion examples/annotations.openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,14 @@
"ReadOnlySingleton",
"TwoReadOnlySet"
],
"parameters": [],
"parameters": [
{
"$ref": "#/components/parameters/top"
},
{
"$ref": "#/components/parameters/skip"
}
],
"responses": {
"200": {
"description": "Retrieved entities",
Expand Down
8 changes: 4 additions & 4 deletions lib/csdl2openapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,8 @@ module.exports.csdl2openapi = function (
*/
function optionSkip(parameters, target, restrictions) {
const supported =
restrictions.SkipSupported !== undefined
? restrictions.SkipSupported
Object.keys(restrictions).length > 0
? restrictions.SkipSupported !== false
: target == null || target[voc.Capabilities.SkipSupported] !== false;

if (supported) {
Expand All @@ -1092,8 +1092,8 @@ module.exports.csdl2openapi = function (
*/
function optionTop(parameters, target, restrictions) {
const supported =
restrictions.TopSupported !== undefined
? restrictions.TopSupported
Object.keys(restrictions).length > 0
? restrictions.TopSupported !== false
: target == null || target[voc.Capabilities.TopSupported] !== false;

if (supported) {
Expand Down

0 comments on commit 3aa3479

Please sign in to comment.