{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Credit card with or without security code",
    "properties": {
        "creditcard": {
            "oneOf": [
                {
                    "additionalProperties": false,
                    "properties": {
                        "provider": {
                            "enum": [
                                "mastercard"
                            ],
                            "type": "string"
                        }
                    },
                    "required": [
                        "provider"
                    ]
                },
                {
                    "additionalProperties": false,
                    "properties": {
                        "provider": {
                            "enum": [
                                "visa"
                            ],
                            "type": "string"
                        },
                        "securitycode": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "provider",
                        "securitycode"
                    ]
                }
            ]
        }
    },
    "title": "Credit card validation",
    "type": "object"
}