Skip to content

Commit

Permalink
Merge pull request #12173 from Akila94/schema-validation-report-fix-p…
Browse files Browse the repository at this point in the history
…ublic

Add schema validation report to message context
  • Loading branch information
tharikaGitHub authored Nov 2, 2023
2 parents 2180de9 + 2e19b17 commit d65d468
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public class APIMgtGatewayConstants {
public static final String HTTP_REQUEST_METHOD = "HTTP_METHOD_OBJECT";
public static final String REST_CONTENT_TYPE = "ContentType";
public static final String REST_MESSAGE_TYPE = "messageType";
public static final String SCHEMA_VALIDATION_REPORT = "schema-validation-report";


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public boolean handleRequest(MessageContext messageContext) {
OpenAPIRequest request = new OpenAPIRequest(messageContext);

ValidationReport validationReport = validator.validateRequest(request);
messageContext.setProperty(APIMgtGatewayConstants.SCHEMA_VALIDATION_REPORT, validationReport);
if (validationReport.hasErrors()) {
StringBuilder finalMessage = new StringBuilder();
for (ValidationReport.Message message : validationReport.getMessages()) {
Expand Down

0 comments on commit d65d468

Please sign in to comment.