hapi-server / uri-templates

Repository of tools for URI templates
Apache License 2.0
2 stars 0 forks source link

extract URI templates code from Autoplot's code base #1

Closed jbfaden closed 4 years ago

jbfaden commented 5 years ago

The URI_templates code, which is exposed as a servlet here http://jfaden.net/AutoplotServlet/URI_Templates.jsp. This should be extracted into its own independent library. I believe the problem is that the Autoplot version uses DatumRange objects to represent time spans and its FileSystem objects to do remote listings.

jbfaden commented 4 years ago

I'd like to get started on this this week. Also, the Java code produced should be easily converted to JavaScript, which I will do as a validation with Bob's assistance.

jbfaden commented 4 years ago

The Java client is written, but Bob and I discovered $v is part of the spec and I didn't really address this. This means additional information needs to be passed out when parsing, so I'll support adding tags to a map. I thought about doing this anyway, to provide the matched $x content.

Also Bob was expecting that I would run against the formatting and parsing json files (https://github.com/hapi-server/uri-templates/blob/master/formatting.json), and this showed we are thinking of the interface slightly differently. I can easily add a static method which will match those expectations.

Last, I noticed that the two interfaces between parse and format are inconsistent. One uses decomposed times, the other uses formatted times.

jbfaden commented 4 years ago

These changes are done. The parse and format methods have a map argument where extra information like version numbers and named fields are kept.