Closed gaby-roland closed 1 year ago
Thank you for collaborating with the project by giving us feedback! Cheers!
Hi @gaby-roland, thanks for the feedback, I'll check it and will provide a fix asap. Cheers
Hi @gaby-roland,
I modified an existing test to reproduce your issue and provide a small fix. Do you mind trying it? BTW, I found we have a problem in how we create the custom validators, that will try to address soon. I think for now, we can only support custom validators about max and min for a single data type. I am considering which will be the best approach .
Cheers
Hi @jemacineiras
Thanks for the quick responses. With your changes I got a new Compilation failure.
This is the generated class, it looks like it duplicates the class line right after defining the maximum
member variable. Lines 8-10 are duplicated on lines 11-13. Hope this helps.
HI @gaby-roland,
got it. Found that issue for the OpenApi part, but miss fixing it for the AsyncApi one. Now I think should work, but with the condition I said before.
Cheers
@jemacineiras Your latest commit seems to work well! It generates the min/max validators properly. I understand that for now we can only use min/max validation for a single type, and that is fine for my use case. Thanks for the quick responses and for working a fix quickly!
It seems like using
minimum
andmaximum
on aninteger
causes a CompilationFailureException as soon as another integer is introduced.I have a very simple sample API spec with a few integer types. The moment I add
minimum
ormaximum
to one of the integer types, it starts causing aCompilationFailureException
.I can use
minimum
andmaximum
as long as I only have one integer in my schema. But adding a second integer breaks it. I can also have as many integers as I want if I don't specifyminimum
ormaximum
.For example, this API spec works for me, and produces the correct classes:
But as soon as I add a second integer under
age
I get the following failure: