Comments (3)
Fixed in v1.3.0
from mongoose-schema-jsonschema.
Hello @DScheglov, I haven't dig too deep into this, however I don't think the current behaviour is correct:
I assume that when we say "programmatically required" we are talking about something like: required: () => someLogic
Then if a field is programmatically required, we can't tell at build time what will be the value of required, so I'd argue that it should default to the field being optional.
from mongoose-schema-jsonschema.
@irvingv8 , actually it makes sense.
So, if required
is a function let's treat it as optional.
What do you think?
from mongoose-schema-jsonschema.
Related Issues (20)
- Add support for "example" field HOT 2
- Add custom options from mongoose schema to json schema HOT 2
- Add support for TypeScript HOT 1
- String minlength and maxlength don't work HOT 1
- 1.4.0 - Error: Cannot find module '../config' HOT 3
- Behaviour of __removeRequired when using selection HOT 4
- Mongoose validators are converted incorrectly HOT 2
- Mongoose "Map" field mapping HOT 2
- Exclude fields using config HOT 4
- Support mongoose 6.0.2 HOT 1
- npm warns mongoose@^5.0.0 required HOT 1
- [Feature Request] Support self reference using definitions HOT 1
- I am not sure how to user custom types HOT 2
- Array of Array is not supported HOT 5
- Usage in NestJS with SchemaFactory.createForClass HOT 1
- Feature Request: Add interface to be more static JsonSchema(mongooseModel) HOT 1
- mongoose schema property 'required' turns to 'true' in json schema if it's declared as a function
- Overriding peer dependency - [email protected] HOT 3
- Using a schema with PatternProperties
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose-schema-jsonschema.