Skip to content

Commit

Permalink
[dsch] fix for the array.required
Browse files Browse the repository at this point in the history
  • Loading branch information
DScheglov committed Oct 12, 2024
1 parent ebecfd7 commit 0d778d9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ function __describe(name, type) {
items: __describe(name && (`itemOf_${name}`), type[0]),
};
delete type.__buildingSchema;
if (t.items.__required) {
t.minItems = 1;
}
delete t.items.__required;
return t;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"jsonschema": "^1.2.2"
},
"peerDependencies": {
"mongoose": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
"mongoose": "^5.13.22"
},
"dependencies": {
"pluralize": "^8.0.0"
Expand Down

3 comments on commit 0d778d9

@ulazdins-afs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @DScheglov !

I'm experiencing issues installing 3.0.0 version:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/mongoose
npm error   mongoose@"7.3.3" from the root project
npm error
npm error Could not resolve dependency:
npm error peer mongoose@"^5.13.22" from [email protected]
npm error node_modules/mongoose-schema-jsonschema
npm error   mongoose-schema-jsonschema@"3.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/ugis.lazdins/.npm/_logs/2024-10-14T06_42_36_644Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/ugis.lazdins/.npm/_logs/2024-10-14T06_42_36_644Z-debug-0.log

seems like "mongoose": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" was a better approach . Do you mind confirming?

@DScheglov
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ulazdins-afs

oh, thank you for reporting this.

The tests for removing minItems for the node@16 and mogoose@5 got failed, so I've install the mongoose 5, and then skip the changes in the package.json file.

Now, it is fixed in the [email protected]

@ulazdins-afs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @DScheglov !

Please sign in to comment.