atomicbits / scraml

Generate typesafe Java and Scala REST API clients
Other
43 stars 7 forks source link

Error While Generating Java Code from raml1.0 #138

Closed somaniab closed 7 years ago

somaniab commented 7 years ago

Hello ,

i am getting errors while generating java code from scraml plugin . i am using raml 1.0 .

Execution generate-client-sources of goal io.atomicbits:scraml-maven-plugin:0.7.0-M1:scraml failed: Error transforming ParsedTypeContext(ParsedDateTimeDefault(ImplicitId,Some(false)),CanonicalLookupHelper(Map(RealCanonicalName(D2LResultDTOString,List

rigolepe commented 7 years ago

Thanks for trying out the new milestone! Could you give me the smallest portion of your RAML model that triggers this error? Date types should give you a string field in your DTO (we don't do JSON to Date parsing and vice versa yet, it will be in one of the next minor releases).

somaniab commented 7 years ago

Hello Peter ,

thanks for replying . Yes you are right , we have some datetime types in our raml ,after removing it , it generated the classes . Is there any fix for the datetime types in raml ?

rigolepe commented 7 years ago

You should be able to leave the dates in there, but they should just generate 'String' fields instead of 'Date' fields for now. I will run some tests using dates myself and see that they at least don't generate errors.

Dates will be in 0.8 and I expect that release somewhere in September.

somaniab commented 7 years ago

using date or datetime type , generates this error and build fails and no java files generated . I have big raml and i can not afford to change raml types everywhere . is there some fix available for this ?

rigolepe commented 7 years ago

I'll try to have a look at it today.

rigolepe commented 7 years ago

Could you test version 0.7.0-M2 ?

somaniab commented 7 years ago

Yes , it worked and replaced date to string in dto .