{
    "additionalProperties": false,
    "oneOf": [
        {
            "properties": {
                "grantType": {
                    "enum": [
                        "authorization_code"
                    ]
                },
                "responseType": {
                    "enum": [
                        "code"
                    ]
                }
            },
            "required": [
                "grantType",
                "responseType"
            ]
        },
        {
            "properties": {
                "grantType": {
                    "enum": [
                        "client_credentials"
                    ]
                },
                "responseType": {
                    "enum": [
                        "token"
                    ]
                }
            },
            "required": [
                "grantType",
                "responseType"
            ]
        }
    ],
    "properties": {
        "clientId": {
            "minLength": 30,
            "type": "string"
        },
        "grantType": {
            "type": "string"
        },
        "redirectUris": {
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "responseType": {
            "type": "string"
        },
        "scopes": {
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "secret": {
            "minLength": 30,
            "type": "string"
        },
        "userId": {
            "description": "MongoDB object ID for the user",
            "maxLength": 12,
            "minLength": 12,
            "pattern": "[0-9a-fA-F]+",
            "type": "string"
        }
    },
    "title": "OAuthClient",
    "type": "object"
}