-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SimpleSchema.oneOf Issue (simple example included) #112
Comments
Is there any news on this bug? I can confirm I'm having a similar issue, simple example:
I don't mind helping submit a PR to fix this? Multiple schemas is going to make this package really powerful! |
@williamtetlow if you've got the time and the knowledge to do this, can you please go ahead and do it, as the issue's labeled with 'help wanted' ? Otherwise, I'll do it, but I'm not that familiar with the library's internals, so it would take longer. |
I've run on this issue too. @zjzeit I found out that the last schema you put in the Any new on this? @TheGame2500 did you manage to fix it? |
@pilarArr no. I was waiting on @williamtetlow to reply. |
@TheGame2500 Sorry been away on holiday. Yep I'll take a look at this over the next couple of days. From a quick scan of the code it doesn't look too difficult to fix. |
Also ran into this issue, any progress? :) |
I have same problem. |
+1 still a problem |
I've done some work on this, but it's a substantial rewrite to the validation flow. Hopefully will have a solution. |
+1 |
- SimpleSchema.oneOf does not work - we can either have strings or objects, not both - see longshotlabs/simpl-schema#112
Thanks for this useful package! Is help needed on this issue @aldeed ? I can see if I can put together a pull request, but I don't want to interfere if you have a substantial rewrite in progress. |
We have a strong use-case for defining multiple schemas for a collection. Without full |
Hi again, just checking in to see if there might be a solution in progress, or if you'd be interested in a pull request to fix this issue. |
Hello @aldeed , if you add the "Help Wanted" flag again, I'll feel more comfortable working on a pull request. Again, I don't want to interfere if you're already working on it. Or, is there anyone else who's familiar with the internals of the package? It might take me longer, since I'm not, but I'm willing to go ahead with it because this is so important. |
Is there any progress on this issue? |
Any news? |
So after 2 years and a half...now what? :D |
Yep, just hit this, would love to see a fix. |
Wow, needless to say this issue dropped off my radar. I really don't remember anything about what I was working on except that it was complicated to fix. I may have even given up trying but forgot to post here. Sorry, but if anyone can fix it without breaking any other tests, please submit a PR. |
any chance the above fix for this ^ is going to make it into the next release? |
Still facing the same Problem |
🎉 This issue has been resolved in version 3.3.0 🎉 The release is available on: If this makes you happy, please consider becoming a sponsor. Your semantic-release bot 📦🚀 |
Below is the example case.
One case has
type: FirstSchema
The other case has
type: SimpleSchema.oneOf(String, Number, FirstSchema, ZeroSchema)
Given the second case contains the first case within
oneOf
, it should work.Shouldn't oneOf test for String, then Number, then FirstSchema, and pass once it tests FirstSchema to be a match?
Also interesting note: if I do
type: SimpleSchema.oneOf(String, Number, FirstSchema)
, i.e., remove theZeroSchema
part, it validates/inserts successfully.The text was updated successfully, but these errors were encountered: