roxy icon indicating copy to clipboard operation
roxy copied to clipboard

%roxy:params annotation regex

Open kefo opened this issue 10 years ago • 5 comments

The regex that establishes whether there are any %roxy:params present during deployment doesn't allow a cardinality indicator, like * or ?. Is this by design?

Also, based on the MarkLogic documentation (and a few examples) the parameter value is supposed to be an XQuery sequence type, like xs:string. What if I wanted to do something like this?

%roxy:params("serialization=json|jsonxml|xml|debugxml")

Is there any reason I can't? I guess more specifically, would a pipe character be allowed?

In both cases I amended the regex and in local tests everything seems fine. No issues with deploying, calling, or viewing.

If *, ?, and | characters are permissible, I'm happy to make a pull request.

kefo avatar Apr 24 '15 19:04 kefo

The test I'd apply is whether 1) POSTing to /v1/config/resource/{name} works and 2) GET /v1/config/resource/{name} shows the parameters as specified, I'm good with it.

dmcassel avatar Apr 24 '15 20:04 dmcassel

I think this got fixed in dev with the pr to support deployment of .sjs..

grtjn avatar Apr 24 '15 20:04 grtjn

Yep, @grtjn's right. https://github.com/marklogic/roxy/blob/dev/deploy/lib/ml_rest.rb#L140

Only thing missing is a pipe character (|). I could probably live with that being a local customization, but, if it is open for discussion, I think it's a nice, clean way to enumerate possible values.

kefo avatar Apr 24 '15 20:04 kefo

The pipe works? Meaning you see it when you look at /v1/config/resource/{name}? Cool, would not have expected that. Like I said, if MarkLogic supports it, no reason Roxy shouldn't.

dmcassel avatar Apr 24 '15 21:04 dmcassel

I'd love to see an example of that. Any deep links to an example in docs maybe?. Note by the way that the param stuff doesn't really do anything within the REST-api. It basically just serves as documentation. I would therefore not be surprised if it would pretty much accept anything..

grtjn avatar Apr 25 '15 18:04 grtjn