Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Aug 23, 2019
1 parent 0d48d4c commit 2751851
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class LowLevelJsonSchemaValidator {

static HttpInputMessage validateMetadataResolverTypePayloadAgainstSchema(HttpInputMessage inputMessage,
JsonSchemaResourceLocationRegistry schemaRegistry) {

def origInput = [inputMessage.body.bytes, inputMessage.headers]
def json = extractJsonPayload(origInput)
def schemaUri = null
Expand All @@ -37,12 +38,17 @@ class LowLevelJsonSchemaValidator {
default:
break
}
if(!schemaUri) {
if (!schemaUri) {
return newInputMessage(origInput)
}
doValidate(origInput, Json.schema(schemaUri), json)
}

static HttpInputMessage validateMetadataFilterTypePayloadAgainstSchema(HttpInputMessage inputMessage,
JsonSchemaResourceLocationRegistry schemaRegistry) {
null
}

private static Json extractJsonPayload(List origInput) {
Json.read(new ByteArrayInputStream(origInput[0]).getText())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import static edu.internet2.tier.shibboleth.admin.ui.jsonschema.LowLevelJsonSche
* @author Dmitriy Kopylenko
*/
@ControllerAdvice
class MetadataResolverSchemaValidatingControllerAdvice extends RequestBodyAdviceAdapter {
class MetadataResolversSchemaValidatingControllerAdvice extends RequestBodyAdviceAdapter {

@Autowired
JsonSchemaResourceLocationRegistry jsonSchemaResourceLocationRegistry
Expand Down

0 comments on commit 2751851

Please sign in to comment.