public IEnumerable Validate()

in src/Azure.Deployments.Extensibility.Core/Validators/ExtensibleResourceValidator.cs [30:46]


        public IEnumerable<ExtensibilityError> Validate(ExtensibleResource<JsonElement> resource)
        {
            // Validate resource type.
            var typeErrors = Validate(resource.GetJsonPointer(x => x.Type), this.typeSchema, resource.Type.AsJsonElement());

            if (typeErrors.Any())
            {
                // Stop validating properties if the resource type is invalid.
                return typeErrors;
            }

            // Validate resource properties.
            var propertiesSchema = this.propertiesSchemaSelector(resource.Type);
            var propertiesErrors = Validate(resource.GetJsonPointer(x => x.Properties), propertiesSchema, resource.Properties);

            return propertiesErrors;
        }