Trying to validate payload swagger-request-validator-core

Hi,

I am trying to use:

com.atlassian.oai swagger-request-validator-core 2.40.0

I use the following code:

I am validating an invalid payload but I get no validation errors in the validationReport.

I am using openapi 3.0.1 as schema and use the following payload.

{
  "event": {
    "commonEventHeader": {
      "version": "4",
      "vesEventListenerVersion": 7,
      "domain": "fault",
      "eventId": "stndDefined-gNB_Nokia000001",
      "eventName": "stndDefined-gNB-Nokia-PowerLost",
      "stndDefinedNamespace": "3GPP-FaultSupervision",
      "startEpochMicrosec": 1413378172000000,
      "lastEpochMicrosec": 1413378172000000,
      "reportingEntityName": "ibcx0001vm002oam001",
      "sourceName": "scfx0001vm002cap001",
      "sequence": 1,
      "priority": "High"
    },
    "stndDefinedFields": {
      "schemaReference": "http://localhost:8080/external1#components/schemas/NotifyNewAlarm",
      "data": {
        "href": 1,
        "uri": "1",
        "notificationId": 1,
        "notificationType": "notifyNewAlarm",
        "eventTime": "xyz",
        "systemDN": "xyz",
        "probableCause": 1,
        "perceivedSeverity": "INDETERMINATE",
        "rootCauseIndicator": false,
        "specificProblem": "xyz",
        "correlatedNotifications": [],
        "backedUpStatus": true,
        "backUpObject": "xyz",
        "trendIndication": "MORE_SEVERE",
        "thresholdInfo": {
          "observedMeasurement": "new",
          "observedValue": 123
        },
        "stateChangeDefinition": {
        },
        "monitoredAttributes": {
          "newAtt": "new"
        },
        "proposedRepairActions": "xyz",
        "additionalText": "xyz",
        "additionalInformation": {
          "addInfo": "new"
        },
        "alarmId": 1,
        "alarmType": "COMMUNICATIONS_ALARM_INVALID"
      },
      "stndDefinedFieldsVersion": "1.0"
    }
  }
}

We used to use openapi4j to do validation but the library is decommissioned.

Any ideas?

br,

//mike

Welcome to the Atlassian developer community @mikaelpetterson,

Unless I misunderstand, your question is about OpenAPI generally, not about developing with Atlassian REST APIs or their OpenAPI specs. I don’t think this community has the expertise that you’re seeking.

Hi
Thanks for reply.
I have been looking for java implementations that can validate a payload vs a openapi schema like 3.0 or 3.1.

I checked what was written about the library on your site:

“A Java library for validating request/responses against a OpenAPI / Swagger specification. Includes support for Swagger v2 and OpenAPI v3 specifications and adapters for common mock and testing libraries.”

What am I missing here?

br,

mike

@mikaelpetterson,

You are correct about both the function of that library and that Atlassian is the author. It’s just that this community site is focused on providing help & support for our commercial products, and their extensibility, not our open source contributions. It’s not wrong to ask here; I just don’t think the developers who work on that library will see your question. I think you have a better chance at getting an answer by posting an issue to the Bitbucket repo.

Thanks @ibuchanan I will do that.