You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My situation is a bit complicated. I'm working on a library to handle API calls to Patreon's APIv2 endpoints. I'm structuring my library similarly to the original. I've already wote most of the resource classes, but the error I'm getting is Class doesn't have a Type annotation. All resource classes must be annotated with a Type annotation! even though it does have one. I've uploaded all of the resource classes to a repo and I've also made a StackOverflow post explaining it in more detail.
The stacktrace I'm getting is: Exception in thread "main" java.lang.IllegalArgumentException: Class [Lpatreon.java.v2.resources.Campaign; doesn't have a Type annotation. All resource classes must be annotated with a Type annotation! at com.github.jasminb.jsonapi.ConverterConfiguration.processClass(ConverterConfiguration.java:168) at com.github.jasminb.jsonapi.ConverterConfiguration.registerType(ConverterConfiguration.java:310) at com.github.jasminb.jsonapi.ConverterConfiguration.processClass(ConverterConfiguration.java:83) at com.github.jasminb.jsonapi.ConverterConfiguration.registerType(ConverterConfiguration.java:310) at com.github.jasminb.jsonapi.ConverterConfiguration.<init>(ConverterConfiguration.java:50) at com.github.jasminb.jsonapi.ResourceConverter.<init>(ResourceConverter.java:93) at com.github.jasminb.jsonapi.ResourceConverter.<init>(ResourceConverter.java:83) at patreon.java.v2.PatreonAPI.<init>(PatreonAPI.java:70) at patreon.java.v2.PatreonAPI.<init>(PatreonAPI.java:60) at patreon.java.v2.PatreonAPITest.main(PatreonAPITest.java:8)
Found out that it was the arrays causing it, I guess for some reason when you use a resource class that has a Type annotation in an array, it doesn't work or something... I don't know. I replaced the arrays with Lists instead.
My situation is a bit complicated. I'm working on a library to handle API calls to Patreon's APIv2 endpoints. I'm structuring my library similarly to the original. I've already wote most of the resource classes, but the error I'm getting is
Class doesn't have a Type annotation. All resource classes must be annotated with a Type annotation!
even though it does have one. I've uploaded all of the resource classes to a repo and I've also made a StackOverflow post explaining it in more detail.The stacktrace I'm getting is:
Exception in thread "main" java.lang.IllegalArgumentException: Class [Lpatreon.java.v2.resources.Campaign; doesn't have a Type annotation. All resource classes must be annotated with a Type annotation! at com.github.jasminb.jsonapi.ConverterConfiguration.processClass(ConverterConfiguration.java:168) at com.github.jasminb.jsonapi.ConverterConfiguration.registerType(ConverterConfiguration.java:310) at com.github.jasminb.jsonapi.ConverterConfiguration.processClass(ConverterConfiguration.java:83) at com.github.jasminb.jsonapi.ConverterConfiguration.registerType(ConverterConfiguration.java:310) at com.github.jasminb.jsonapi.ConverterConfiguration.<init>(ConverterConfiguration.java:50) at com.github.jasminb.jsonapi.ResourceConverter.<init>(ResourceConverter.java:93) at com.github.jasminb.jsonapi.ResourceConverter.<init>(ResourceConverter.java:83) at patreon.java.v2.PatreonAPI.<init>(PatreonAPI.java:70) at patreon.java.v2.PatreonAPI.<init>(PatreonAPI.java:60) at patreon.java.v2.PatreonAPITest.main(PatreonAPITest.java:8)
The Campaign class does have a Type annotation:
The ResourceConverter is being initialized like so:
I've found that at stack "ConverterConfiguration.processClass(Class<?>) line: 83", targetType is set to Campaign, but clazz is set to Address:
In the Address class, the only reference to the Campaign class is an Array of Campaigns with a Relationship annotation:
The text was updated successfully, but these errors were encountered: