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

Property for envelope style preference #291

Closed grechaw closed 7 years ago

grechaw commented 7 years ago

This is an implementation idea to be discussed in the 9.0-3 design changes.

Introduce a new key in a model's info section

"envelopeStyle" : "JSON|XML|Mixed",
"preferredIndex": "path|node"

The first key will determine wheter an instance converter will be generated for JSON envelopes, XML envelopes, or an environment that uses both. The differences will be in how namespaced elements are handled for database properties and search options generation.

The second key, something requested by the field, would determine whether those same functions will generated element-range-index or path-range indexes, which is the default today.

grechaw commented 7 years ago

The WG rejected the idea of a vocabulary item for envelope style, but think it's rather part of the API. So my spec updates include function changes to accommodate this requirement idea. As part of the output from es:instance-converter-generate(), these functions will be available in 9.0-3:

(new) instance-to-canonical-json()
instance-to-canonical-xml
(new) instnace-to-json-envelope()
(new) instance-to-xml-envelope()
instance-to-envelope()
grechaw commented 7 years ago

I sent along a query to data integration group about this item -- I think it might still be required.

grechaw commented 7 years ago

The ideas in this issue have been superceded by, I think, better ones, so I'll remove this issue and open a new one for what we're actually building.