Class ValidationController

java.lang.Object
gov.niem.tools.api.validation.ValidationController

@RestController @RequestMapping(value="/validation", consumes="multipart/form-data") public class ValidationController extends Object
REST controller for validation.
  • Constructor Details

    • ValidationController

      public ValidationController()
  • Method Details

    • getXsdValidation

      @PostMapping("schemas/xml") public Object getXsdValidation(@RequestPart org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false,defaultValue="json") TestReport.ResultsFormat mediaType) throws Exception
      Validate one or more XML Schemas.
      Parameters:
      file - REQUEST BODY PARAMETER. Single XML Schema or a zip file containing multiple XML Schemas.
      mediaType - File format for the validation results.
      Throws:
      Exception
    • getXmlValidation

      @PostMapping("instances/xml") public Object getXmlValidation(@RequestPart org.springframework.web.multipart.MultipartFile xml, @RequestPart org.springframework.web.multipart.MultipartFile xsd, @RequestParam(required=false,defaultValue="json") TestReport.ResultsFormat mediaType) throws Exception
      Validate one or more XML instances against XML schemas.
      Parameters:
      xml - An XML instance file or set of XML instance files in a zip file.
      xsd - An XML schema or set of XML schemas in a zip file.
      mediaType - REQUEST BODY PARAMETER. File format for the validation results.
      Throws:
      Exception
    • getXmlCatalogXmlValidation

      @PostMapping("xml-catalog") public Object getXmlCatalogXmlValidation(@RequestPart org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false,defaultValue="json") TestReport.ResultsFormat mediaType) throws Exception
      Validate a XML catalog against the OASIS catalog schema.
      Parameters:
      file - An XML catalog file.
      mediaType - REQUEST BODY PARAMETER. File format for the validation results.
      Throws:
      Exception
    • getMessageCatalogXmlValidation

      @PostMapping("message-catalog") public Object getMessageCatalogXmlValidation(@RequestPart org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false,defaultValue="json") TestReport.ResultsFormat mediaType) throws Exception
      Validate an IEPD / message catalog instance file against the NIEM IEPD / message catalog schema.
      Parameters:
      file - An IEPD / message catalog instance file
      mediaType - REQUEST BODY PARAMETER. File format for the validation results.
      Throws:
      Exception
    • getCmfXmlValidation

      @PostMapping("cmf/xml") public Object getCmfXmlValidation(@RequestPart org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false,defaultValue="json") TestReport.ResultsFormat mediaType) throws Exception
      Validate a CMF XML file against the NIEM CMF XML schema.
      Parameters:
      file - A CMF XML file.
      mediaType - REQUEST BODY PARAMETER. File format for the validation results.
      Throws:
      Exception
    • getMessageSpecificationValidation

      @PostMapping("message-specification") public Object getMessageSpecificationValidation(@RequestPart org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false,defaultValue="json") TestReport.ResultsFormat mediaType) throws Exception
      Validate a message specification or IEPD zip file against NIEM message specification / IEPD conformance rules.

      Runs the following checks:

      • Validates the MPD or IEPD catalog.
      • Validates XML catalogs
      • Validates XML schemas
      • Validates XML schemas against NDR conformance rules
      Parameters:
      file - A message specification or IEPD zip file.
      mediaType - REQUEST BODY PARAMETER. File format for the validation results.
      Throws:
      Exception
    • getSchemaNdrValidation

      @PostMapping("schemas/ndr") public Object getSchemaNdrValidation(@RequestPart org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false,defaultValue="json") TestReport.ResultsFormat mediaType) throws Exception
      Validate one or more XML Schemas against the NIEM Naming and Design Rules (NDR).
      Parameters:
      file - XML Schema or zip file
      mediaType - REQUEST BODY PARAMETER. File format for the validation results.
      Throws:
      Exception
    • getSchemaJsonValidation

      @PostMapping("schemas/json") public TestReport getSchemaJsonValidation(@RequestPart org.springframework.web.multipart.MultipartFile file)
      Validate a JSON Schema.
      Parameters:
      file - A JSON Schema file
    • getSchemaQaValidation

      @PostMapping("schemas/qa") public TestReport getSchemaQaValidation(@RequestPart org.springframework.web.multipart.MultipartFile file)
      Validate a XML schema against NIEM qa rules and best practices.
    • getInstanceJsonValidation

      @PostMapping("instances/json") public TestReport getInstanceJsonValidation(@RequestPart org.springframework.web.multipart.MultipartFile json, @RequestPart org.springframework.web.multipart.MultipartFile jsonSchema)
      Validate one or more JSON instances against a JSON Schema.
      Parameters:
      json - A JSON instance file or set of JSON instance files in a zip file.
      jsonSchema - A JSON Schema file.
    • getCmfNdrValidation

      @PostMapping("cmf/ndr") public TestReport getCmfNdrValidation(@RequestPart org.springframework.web.multipart.MultipartFile file)
      Validate a CMF XML file against NIEM CMF NDR rules.
    • getCmfQaValidation

      @PostMapping("cmf/qa") public TestReport getCmfQaValidation(@RequestPart org.springframework.web.multipart.MultipartFile file)
      Validate a CMF XML file against NIEM QA rules and best practices.
    • getPropertyQaValidation

      @PostMapping("properties/qa") public TestReport getPropertyQaValidation(@RequestPart Property property, @PathVariable(required=false) String niemVersionNumber)
      Check a property for basic NDR conformance issues.
      Parameters:
      property - A NIEM property
      niemVersionNumber - Applicable base NIEM version number. Defaults to the current version if not provided.
    • getTypeQaValidation

      @PostMapping("types/qa") public TestReport getTypeQaValidation(@RequestPart Type type, @PathVariable(required=false) String niemVersionNumber)
      Check a property for basic NDR conformance issues.
      Parameters:
      type - A NIEM type
      niemVersionNumber - Applicable base NIEM version number. Defaults to the current version if not provided.