core/src/main/java/io/fabric8/maven/core/util/validator/ResourceValidator.java
public int validate() throws ConstraintViolationException, IOException {
        for(File resource: resources) {
            if (resource.isFile() && resource.exists()) {
                try {
                    log.info("validating %s resource", resource.toString());
                    JsonNode inputSpecNode = geFileContent(resource);
                    String kind = inputSpecNode.get("kind").toString();
                    JsonSchema schema = getJsonSchema(prepareSchemaUrl(SCHEMA_JSON), kind);
                    Set<ValidationMessage> errors = schema.validate(inputSpecNode);
                    processErrors(errors, resource);
                } catch (URISyntaxException e) {
                    throw new IOException(e);
                }
            }
        }

        return resources.length;
    }
public int validate() throws ConstraintViolationException, IOException {
        for(File resource: resources) {
            if (resource.isFile() && resource.exists()) {
                try {
                    log.info("validating %s resource", resource.toString());
                    JsonNode inputSpecNode = geFileContent(resource);
                    String kind = inputSpecNode.get("kind").toString();
                    JsonSchema schema = getJsonSchema(prepareSchemaUrl(SCHEMA_JSON), kind);
                    Set<ValidationMessage> errors = schema.validate(inputSpecNode);
                    processErrors(errors, resource);
                } catch (URISyntaxException e) {
                    throw new IOException(e);
                }
            }
        }

        return resources.length;
    }
public int validate ( ) throws ConstraintViolationException , IOException { for ( File resource : resources ) { if ( resource . isFile ( ) && resource . exists ( ) ) { try { log . info ( "validating %s resource" , resource . toString ( ) ) ; JsonNode inputSpecNode = geFileContent ( resource ) ; String kind = inputSpecNode . get ( "kind" ) . toString ( ) ; JsonSchema schema = getJsonSchema ( prepareSchemaUrl ( SCHEMA_JSON ) , kind ) ; Set < ValidationMessage > errors = schema . validate ( inputSpecNode ) ; processErrors ( errors , resource ) ; } catch ( URISyntaxException e ) { throw new IOException ( e ) ; } } } return resources . length ; }
Validates the resource descriptors as per JSON schema. If any resource is invalid it throws @{@link ConstraintViolationException} with
all violated constraints

@return number of resources processed
@throws ConstraintViolationException
@throws IOException
Validates the resource descriptors as per JSON schema . If any resource is invalid it throws @ { @link ConstraintViolationException } with all violated constraints