Class ExportValidatorController
java.lang.Object
com.markvarga21.studentmanager.controller.ExportValidatorController
@RestController
@RequestMapping("/api/v1/export")
@CrossOrigin
public class ExportValidatorController
extends Object
A controller class, which is used to validate exported
XML and JSON data with predefined schemas.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Boolean>
validateJsonExport
(com.fasterxml.jackson.databind.JsonNode json) Validates the exported JSON data.org.springframework.http.ResponseEntity<Boolean>
validateXmlExport
(String xml) Validates the exported XML data.
-
Constructor Details
-
ExportValidatorController
public ExportValidatorController()
-
-
Method Details
-
validateXmlExport
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/validate/xml") public org.springframework.http.ResponseEntity<Boolean> validateXmlExport(@RequestBody String xml) Validates the exported XML data.- Parameters:
xml
- The exported XML data.- Returns:
- The validation result.
-
validateJsonExport
@PostMapping("/validate/json") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<Boolean> validateJsonExport(@RequestBody com.fasterxml.jackson.databind.JsonNode json) Validates the exported JSON data.- Parameters:
json
- The exported JSON data.- Returns:
- The validation result.
-