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() is not generating all path-namespaces from model in e2e #342

Closed bsrikan closed 6 years ago

bsrikan commented 7 years ago

Model valid-ref.json in e2e has 2 namespaces with prefix 'cust' and 'ord' but only one is generated in database-properties-generate()

{
"database-name": "%%DATABASE%%", 
"schema-database": "%%SCHEMAS_DATABASE%%", 
"path-namespace": [
{
"prefix": "cust", 
"namespace-uri": "http://marklogic.com/customer"
}, 
{
"prefix": "es", 
"namespace-uri": "http://marklogic.com/entity-services"
}
grechaw commented 7 years ago

I think your working copy of valid-ref-2 is not on github yet? I'd like to examine it, as it seemed like other similar model descriptors were working OK.

bsrikan commented 7 years ago

Attached those models herewith. e2e_ns_Models.zip

grechaw commented 7 years ago

thanks ill check them out.

grechaw commented 7 years ago

OK -- not a bug.

I found where in the code I am neglecting to include path range indexes for namespaces. Turns out behavior is correct.

If there are element range indexes, then the namespace information is included right in the element-range-index block. It doesn't need an entry in path-namespaces to resolve it.

So for those types with element-range-index, but not a path-index, there will be no path-namespace definition.

Back to you for verification

bsrikan commented 7 years ago

Agree with dev comments. Shipping the issue as not a bug.