hapi-server / uri-templates

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

Java reference version must avoid overloaded methods and other things that don't translate to other languages #14

Closed jbfaden closed 1 month ago

jbfaden commented 1 year ago

I've been working on a translator to Python this week, and reviewing the JavaScript version of TimeUtil.js I see that overloaded methods don't translate well. For example, formatIso8601Time( int[] nn, int offset ) has a convenience method for the typical case where the offset is zero and it's just a seven-element time, with no offset specified: formatIso8601Time( int[] nn ). These overloaded methods don't translate into JavaScript and Python nicely, and should be avoided.

Other language features which fall into this category should also be documented here.

jbfaden commented 1 year ago

I've replaced the method which takes a 14-element timerange with formatIso8601TimeInTimeRangeBrief and formatIso8601TimeInTimeRange, so that it's more clear why they differ.

jbfaden commented 1 year ago

See also https://github.com/hapi-server/uri-templates/issues/13