Skip to content
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

errorUnknown #531

Merged
merged 5 commits into from
Jan 12, 2019
Merged

errorUnknown #531

merged 5 commits into from
Jan 12, 2019

Conversation

dobrynin
Copy link
Contributor

@dobrynin dobrynin commented Jan 8, 2019

Summary:

errorUnknown, when set to true, will throw an error if parseDynamo
encounters a record with a field at any level that is not specified in
the Schema.

Schema

const schema = new Schema({
  knownAttribute: String,
}, {
  errorUnknown: true,
});

General

If this record were encountered with the above schema, an error would be
thrown.

const record = {
  knownAttribute: { S: 'I am known to the schema. Everything is groovy.' },
  unknownAttribute: { S: 'I am but a stranger to the schema. I will cause an error.' }
}

Type (select 1):

  • Bug fix
  • Feature implementation
  • Documentation improvement
  • Testing improvement

Is this a breaking change? (select 1):

  • 🚨 YES 🚨
  • No
  • I'm not sure

Is this ready to be merged into Dynamoose? (select 1):

  • Yes
  • No

Are all the tests currently passing on this PR? (select 1):

  • Yes
  • No

Other:

  • I have searched through the GitHub pull requests to ensure this PR has not already been submitted
  • I have updated the Dynamoose documentation (if required) given the changes I made
  • I have added/updated the Dynamoose test cases (if required) given the changes I made
  • I have run npm test from the root of the project directory to ensure all tests continue to pass
  • I agree that all changes made in this pull request may be distributed and are made available in accordance with the Dynamoose license
  • All of my commits and commit messages are detailed, explain what changes were made, and are easy to follow and understand
  • I have confirmed that all my code changes are indented properly using 2 spaces
  • I have filled out all fields above

@dobrynin dobrynin changed the title errorUnknown, when set to true, will throw an error if parseDynamo encounters a record with a field at any level that is not specified in the Schema. errorUnknown Jan 8, 2019
@coveralls
Copy link

Pull Request Test Coverage Report for Build 838

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 85.588%

Totals Coverage Status
Change from base Build 835: 0.1%
Covered Lines: 2197
Relevant Lines: 2491

💛 - Coveralls

2 similar comments
@coveralls
Copy link

Pull Request Test Coverage Report for Build 838

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 85.588%

Totals Coverage Status
Change from base Build 835: 0.1%
Covered Lines: 2197
Relevant Lines: 2491

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 838

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 85.588%

Totals Coverage Status
Change from base Build 835: 0.1%
Covered Lines: 2197
Relevant Lines: 2491

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jan 8, 2019

Pull Request Test Coverage Report for Build 849

  • 15 of 15 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 85.507%

Totals Coverage Status
Change from base Build 835: 0.06%
Covered Lines: 2203
Relevant Lines: 2499

💛 - Coveralls

Copy link
Member

@fishcharlie fishcharlie left a comment

Choose a reason for hiding this comment

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

We need to add this option to the documentation as well

lib/Schema.js Outdated Show resolved Hide resolved
lib/Schema.js Outdated Show resolved Hide resolved
lib/Attribute.js Outdated Show resolved Hide resolved
test/Schema.js Show resolved Hide resolved
fishcharlie and others added 3 commits January 10, 2019 14:45
Co-Authored-By: dobrynin <David.Dobrynin@gmail.com>
Co-Authored-By: dobrynin <David.Dobrynin@gmail.com>
@dobrynin
Copy link
Contributor Author

@fishcharlie please take a look at the changes I pushed and my responses to your comments :)

@dobrynin dobrynin mentioned this pull request Jan 11, 2019
Copy link
Member

@fishcharlie fishcharlie left a comment

Choose a reason for hiding this comment

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

LGTM

@fishcharlie
Copy link
Member

@dobrynin Wait sorry. This needs documentation changes doesn't it?

@fishcharlie fishcharlie mentioned this pull request Jan 11, 2019
@dobrynin
Copy link
Contributor Author

Good point. Added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants