-
Notifications
You must be signed in to change notification settings - Fork 181
java.time APIs and RAML Types #294
Comments
Hi - wondered if there was any answer to this? Other than doing some JavaPoet type work on our own ? |
Right now, it's java poet stuff. Which is a bit of a pain. However, i'm working on a raml-to-pojo (which would be used by ramlforjaxrs) that would swap them out wholesale. |
Excellent - I am currently working on specifying an approach for our applications. Would I be better waiting on this to bottom out (ie for you to finish this work). I am currently using annotationTypes to map className properties so that we generate java.time.Local date (creating a ramltojaxrs.raml) file in the process. This seems to work well for our use cases at this early stage. We are also using a similar technique to generate Lombok builder annotations (using your @depricated example as inspiration!). This allows us to generate builders on our generates Impl classes which is very useful with the layers of our apps. Will this be maintained moving forward? Do you have another view regarding this approach? |
Ooooooh. Lombok. That's a great idea. Unfortunately, the RAML type have changed the way of writing plugins a bit. As to changing the type, you can now (in release/2.2.0) change the type being used. You could check out this annotation: #%RAML 1.0
title: Hello World API
version: v1
baseUri: https://api.github.com
mediaType: application/json
uses:
ramltopojo: ramltopojo.raml
/search:
description: The search resource
uriParameters:
id:
type: date
(ramltopojo.types):
plugins:
- name: core.changeType
arguments: [ java.time.LocalDate ] |
Hi Belanger, Where can i find the ramltopojo.raml? Please help. Regards, |
Thanks Belanger Basically, ours is third-party RAML and not supposed to update it. So I tried another approach by adding MapperConfiguration in pom.xml as attached, jsonMapperConfiguration.txt Thank you Regards, |
Bit late.. but cant you write an overaly or extension raml to the raml you are not allowed to change.. so that you CAN modify it for your annotation use without affecting the base raml? |
Is there a way to use java.time APIs (e.g. LocalDateTime, LocalDate and LocalTime, ecc.) with RAML Types like datetime, date-only, time-only, ecc.?
The text was updated successfully, but these errors were encountered: