Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-4353

JSON schema plugin is not working with multiple events mentioned in apex config with "|" separator

    XMLWordPrintable

Details

    Description

      The JSON schema plugin is not working with multiple events mentioned in apex config using the "|" separator. Basically, this is a very corner case where the difference between the schemas for success & failure event is based on nested parameters inside child object in a JSON schema.

      For example: 

      CDS success response event

      {
          "correlationUUID": null,
          "commonHeader": {
              "timestamp": "2020-12-16T10:29:00.450Z",
              "originatorId": "POLICY",
              "requestId": "f392e439-c176-411b-b972-8acadac0f8df",
              "subRequestId": "8c7935a4-79d8-4ec0-b661-dcca3cd68006",
              "flags": null
          },
          "actionIdentifiers": {
              "blueprintName": "apex-example-cba",
              "blueprintVersion": "1.0.0",
              "actionName": "modify-config",
              "mode": "sync"
          },
          "status": {
              "code": 200,
              "eventType": "EVENT_COMPONENT_EXECUTED",
              "timestamp": "2020-12-16T10:29:01.737Z",
              "errorMessage": null,
              "message": "success"
          },
          "payload": {
              "modify-config-response": {
                  "execute-command-logs": [
                      "INFO:root:Arguments : Active,,"
                  ],
                  "prepare-environment-logs": [
                      "Installed pip packages:\n   requirements.txt\n\n"
                  ]
              }
          }
      } 

      CDS failure response event

      {
          "correlationUUID": null,
          "commonHeader": {
              "timestamp": "2020-12-16T11:02:01.584Z",
              "originatorId": "POLICY",
              "requestId": "f392e439-c176-411b-b972-8acadac0f8df",
              "subRequestId": "8c7935a4-79d8-4ec0-b661-dcca3cd68006",
              "flags": null
          },
          "actionIdentifiers": {
              "blueprintName": "apex-example-cba",
              "blueprintVersion": "1.0.0",
              "actionName": "modify-config",
              "mode": "sync"
          },
          "status": {
              "code": 500,
              "eventType": "EVENT_COMPONENT_FAILURE",
              "timestamp": "2020-12-16T11:02:02.185Z",
              "errorMessage": "ConfigModify operation failed. failed to get cba file name(apex-example-cba), version(1.0.0) from db : file check failed.",
              "message": "failure"
          },
          "payload": {
              "modify-config-response": {
                  "execute-command-logs": [
                      "INFO:root:Arguments : Inactive,,"
                  ],
                  "prepare-environment-logs": [
                      "Installed pip packages:\n   requirements.txt\n\n"
                  ]
              }
          }
      }

      The only difference in above 2 events lies inside the parameters in the "status" object, which is getting ignored while making the schema comparison. And hence JSON plugin is going ahead with the first schema mentioned in the "|" sequence.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ramverma Ram Krishna Verma
            ramverma Ram Krishna Verma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: