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

Typecasting failed: No typecaster defined for Object. #104

Open
alonrbar opened this issue Nov 25, 2019 · 0 comments
Open

Typecasting failed: No typecaster defined for Object. #104

alonrbar opened this issue Nov 25, 2019 · 0 comments

Comments

@alonrbar
Copy link

alonrbar commented Nov 25, 2019

Hi,

After upgrading from v5.0.0 to v5.1.0 I'm experiencing an issue with this schema definition:

const definition = {    
    "userId": {
        "type": String,
        "required": true
    },
    "userIdType": {
        "type": String,
        "required": true,
        "enum": [
            "UserId",
            "GroupId",
            "UserEmail"
        ]
    }
}

When validating a valid object I get "Typecasting failed: No typecaster defined for Object.".

In v5.1.0 when I inspect the created schema object I see this under schema.props (notice the "_type: Object" in "userId"):

{
    "userId": { 
        _type: Object,
       /// rest omitted...
    },
    "userId.required": { 
        _type: null,
       ///  rest omitted...
    }
    "userId.type": { 
        _type: String,
       ///  rest omitted...
    },
    "userIdType": { 
        _type: String,
       ///  rest omitted...
    }
}

In v5.0.0 when I inspect the created schema object I see this under schema.props (notice the "_type: null" in "userId"):

{
    "userId": { 
        _type: null,
       /// rest omitted...
    },
    "userId.required": { 
        _type: null,
       ///  rest omitted...
    }
    "userId.type": { 
        _type: String,
       ///  rest omitted...
    },
    "userIdType": { 
        _type: String,
       ///  rest omitted...
    }
}

Thanks

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

No branches or pull requests

1 participant