Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date rendering #40

Open
leforthomas opened this issue Apr 27, 2021 · 7 comments
Open

Date rendering #40

leforthomas opened this issue Apr 27, 2021 · 7 comments

Comments

@leforthomas
Copy link

leforthomas commented Apr 27, 2021

First of all, thanks for this module. I can generate everything fine except dates with which I have an issue. If I use Java Date then I get an integer in my openapi.yml file and if I use say a LocalDateTime I do get a string but with an unspecified format.

I had a quick check at the code and it appears to imply it should generate strings with the date-time format in both cases.

Can you let me know if I need to add some additional annotations or else?

(I use release 1.1.5)

@jskov-jyskebank-dk
Copy link
Collaborator

Did you look at the tests?

https://github.com/stoicflame/enunciate-openapi/tree/master/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/date

There might be a hint (if it has not broken for some reason)

@leforthomas
Copy link
Author

Thanks. Yes, I was looking at the tests. The only difference I can see with my code is mine is not XML. I will try with your exact code in my project and see what comes out.

@jskov-jyskebank-dk
Copy link
Collaborator

That is probably your answer; the code relies on data picked up by Enunciate's xml module, as far as I recall.

@leforthomas
Copy link
Author

I see, thanks

@jskov-jyskebank-dk
Copy link
Collaborator

My point is; we were using XML annotations as input.

This module could probably be fixed to handle other types as well.
There are tests for some jackson1/jackson2 annotations, but not Date.

In any event, this is all the help I can provide you.

@leforthomas
Copy link
Author

Yep. If I were to add support for dates for jackson2, where would I start?

@jskov-jyskebank-dk
Copy link
Collaborator

It is 2 years since I touched it last. 3 or 4 since I worked on in earnest. So I could not tell you, off hand.

Maybe use the XML based date-tests to find the code that is relevant to dates.
Then use that to figure out why there is no type data, when it is annotated with something else than XML annotations.

Sorry, not much help. But I do not have time (or interest) in diving deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants