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

Change functions {type}:instance-to-canonical($instance) arguments #338

Closed grechaw closed 7 years ago

grechaw commented 7 years ago

In WG review, we decided to change how to express the API for instance and envelope creation.

This issue is to track updates to spec and to implementation and tests.

instead of

instance-to-canonical-xml($instance)
instance-to-canonical-json($instance)
:

We introduce a two-argument version of {$type}:instance-to-canonical($instance, $envelope-format)

If the second argument is "json" then a JSON canonical instance is returned. If it's "xml" then the XML version is returned.

The existing function, retained for backward-compatibility, calls instance-to-envelope($intance, "xml").

grechaw commented 7 years ago

This was not a difficult change to do. I've got it working locally and will prepare a PR this afternoon.

bsrikan commented 7 years ago

Verified. Shipping the issue.