marklogic / entity-services

Data modeling and code scaffolding for data integration in MarkLogic
https://docs.marklogic.com/guide/entity-services
Apache License 2.0
7 stars 10 forks source link

database-properties-generate() shows an empty "element-range-index" property #317

Closed bsrikan closed 7 years ago

bsrikan commented 7 years ago

If a model doesnt have an "element-range-index" property defined, database-properties-generate() still shows "element-range-index" as an empty property. This should not be the case.

Actual:

{  
  "database-name":"%%DATABASE%%",
  "schema-database":"%%SCHEMAS_DATABASE%%",
  "path-namespace":[  
    {  
      "prefix":"es",
      "namespace-uri":"http://marklogic.com/entity-services"
    }
  ],
  "element-word-lexicon":[  
    {  
      "collation":"http://marklogic.com/collation/en",
      "localname":"CustomerId",
      "namespace-uri":""
    }  ],
  "range-path-index":[  
    {  
      "collation":"http://marklogic.com/collation/en",
      "invalid-values":"reject",
      "path-expression":"//es:instance/Customer/CompanyName",
      "range-value-positions":false,
      "scalar-type":"string"
    }  ],
  "range-element-index":[  
                   //This is not expected
  ],
  "triple-index":true,
  "collection-lexicon":true
}

Expected:

{  
  "database-name":"%%DATABASE%%",
  "schema-database":"%%SCHEMAS_DATABASE%%",
  "path-namespace":[  
    {  
      "prefix":"es",
      "namespace-uri":"http://marklogic.com/entity-services"
    }
  ],
  "element-word-lexicon":[  
    {  
      "collation":"http://marklogic.com/collation/en",
      "localname":"CustomerId",
      "namespace-uri":""
    }  ],
  "range-path-index":[  
    {  
      "collation":"http://marklogic.com/collation/en",
      "invalid-values":"reject",
      "path-expression":"//es:instance/Customer/CompanyName",
      "range-value-positions":false,
      "scalar-type":"string"
    }  ],
  "triple-index":true,
  "collection-lexicon":true
}
grechaw commented 7 years ago

looks like we do that with all of them:

{ "database-name": "%%DATABASE%%", "schema-database": "%%SCHEMAS_DATABASE%%", "path-namespace": [ { "prefix": "es", "namespace-uri": "http://marklogic.com/entity-services" }], "element-word-lexicon": [], "range-path-index": [], "range-element-index": [], "triple-index": true, "collection-lexicon": true }

grechaw commented 7 years ago

added this issue to PR.

bsrikan commented 7 years ago

Verified the fix. Working as expected.

bsrikan commented 7 years ago

Shipping the issue.