Skip to content

Error thrown if Object type default value has a property with a period #271

Description

@shane-tomlinson

This test case fails:

diff --git a/test/validation-tests.js b/test/validation-tests.js
index d3a3dfe..45f7dcd 100644
--- a/test/validation-tests.js
+++ b/test/validation-tests.js
@@ -239,4 +239,19 @@ describe('schema contains an object property with a custom format', function() {
       config.validate({ allowed: 'strict' });
     }).must.not.throw();
   });
+  it("must not throw if an object's default value property name contains a period", function() {
+    (function() {
+      const config = convict({
+        object: {
+          doc: 'default value contains property name that contains a period',
+          format: Object,
+          default: {
+            'foo.bar': ''
+          }
+        }
+      });
+
+      config.validate();
+    }).must.not.throw();
+  });
 });

blocks mozilla/fxa-content-server#6445

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions