private void ValidatePropertyName(JsonSchemaModel schema)
{
if (schema == null)
{
return;
}
string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture);
if (_currentScope.RequiredProperties.ContainsKey(propertyName))
{
_currentScope.RequiredProperties[propertyName] = true;
}
if (!schema.AllowAdditionalProperties)
{
bool propertyDefinied = IsPropertyDefinied(schema, propertyName);
if (!propertyDefinied)
{
RaiseError("Property '{0}' has not been defined and the schema does not allow additional properties.".FormatWith(CultureInfo.InvariantCulture, propertyName), schema);
}
}
_currentScope.CurrentPropertyName = propertyName;
}