meteor / meteor/validated-method

defaultValues on fields that are not optional

Open
#81 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
193
Forks
29
PR merge metrics
No merged PRs in 30d

Description

This code fails the validation when the key is left out. I was using simple schema and attaching it to collections originally. I'd like to migrate to validatedMethod. Any strategies to combine the two that work? I have simple schema setting a lot of defaults throughout the app..
```
eurPrice: {
type: String,
regEx: /(?=.*\d)^\$?(([1-9]\d{0,2}(,\d{3})*)|0)?(\.\d{1,2})?$/,
label: 'EUR Price',
defaultValue: '0',
},
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reproducing the validation failure with the provided SimpleSchema field and inspect how validated-method handles omitted keys and SimpleSchema defaults. Done requires an agreed behavior for defaultValue on non-optional fields, demonstrated by a regression test or clarified documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.