%roxy:params annotation regex
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.
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.
I think this got fixed in dev with the pr to support deployment of .sjs..
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.
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.
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..