-
Notifications
You must be signed in to change notification settings - Fork 434
Closed
Description
Given the json schema:
{
"title": "CreateAppUserInput",
"type": "object",
"properties": {
"accountId": { "type": "string" },
"applicationId": { "type": "string" },
"avatarUrl": { "type": "string" },
"dateOfBirth": { "type": "string", "format": "date-time" },
"email": { "type": "string" },
"firstName": { "type": "string" },
"gender": {
"type": "string",
"enum": ["FEMALE", "MALE", "OTHER"]
},
"lastName": { "type": "string" },
"organizationId": { "type": "string" },
"phoneNumber": { "type" : "string" },
"sourceId": { "type": "string" }
},
"required": ["applicationId", "organizationId"],
"anyOf": [
{ "required": ["email"] },
{ "required": ["phoneNumber"] }
],
"minProperties": 1,
"additionalProperties": false
}I am getting the type of:
export type CreateAppUserInput = {
[k: string]: any;
};The issue is the anyOf, the requirement is that at least one of those two be present. The validator that uses this schema is working correctly so I'm just unsure if maybe there something I could change to get a correct type?
maxwellium