Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-10796

XSite XML configuration not translated to correct JSON

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • 10.0.0.CR3
    • Configuration
    • None

    Description

      An XML cache configuration like this:

      <infinispan>
          <cache-container>
              <distributed-cache name="example" mode="SYNC">
                  <backups>
                      <backup site="SiteA" strategy="ASYNC" timeout="30000"/>
                  </backups>
              </distributed-cache>
          </cache-container>
      </infinispan>   
      

      Can be created with curl with:

      curl -v -u ... -d '<infinispan><cache-container><distributed-cache name="example" mode="SYNC"><backups><backup site="SiteA" strategy="ASYNC" timeout="30000"/></backups></distributed-cache></cache-container></infinispan>' -H "Content-Type: application/xml" -X POST .../rest/v2/caches/example2
      

      Retrieving it as JSON returns:

      @g ~ $ curl -u ... -H "Content-Type: application/json" .../rest/v2/caches/example2?action=config | jq
      {
        "distributed-cache": {
          "mode": "SYNC",
          "backups": {
            "backup": {
              "site": "SiteA",
              "strategy": "ASYNC",
              "timeout": 30000
            }
          },
          "transaction": {
            "mode": "NONE"
          }
        }
      }
      

      That JSON is correct. Backups should be an array.

      An FAQ should be added so that users know how to transform XML configuration to JSON. JSON is way less verbose, so might be preferable for curl commands.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rh-ee-galder Galder ZamarreƱo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: