damnhandy / Handy-URI-Templates

A Java URI Template processor implementing RFC6570

Home Page:https://damnhandy.github.io/Handy-URI-Templates/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expanding enums

vicmosin opened this issue · comments

Enums wouldn't be captured there, but here:

https://github.com/damnhandy/Handy-URI-Templates/blob/master/src/main/java/com/damnhandy/uri/template/UriTemplate.java#L609

The DefaultVarExploder should only be called when the type is not a primitive, CharSequence, Number, or Date type. I haven't tested enums, but there probably needs to be some thought into how they are handled.

So they are not)) it fails with The value must an object exception

Clearly not tested :) I'll have a gander at this over the weekend.

@vicmosin I'm really surprised that such an obvious bug took 4 years for someone to find it. Thanks for the report. A few minor tweaks and it's functional now. I've pushed a snapshot to Maven Central under version 2.1.0-SNAPSHOT Should have a release out by the end of the weekend.

Confirmed, 2.1.0-SNAPSHOT fixes the issue.
What about 2.0.5-SNAPSHOT described in docs?

I'm going straight to 2.1. Should be posting that later today.