Closed techpavan closed 5 years ago
I had the same issue and discovered that it works fine if specify optional parameters using "required: false" instead of short notation using question mark in the end of property name)
The problem is in raml-parser-2
library.
The issue is reported - https://github.com/raml-org/raml-java-parser/issues/411
There might be a workaround for this issue.
Instead of getting data type from response object it should be possible to generate POJOs straight from data types definition at the root of document.
I will consider this approach if the issue in raml-parser-2
doesn't get resolved soon.
The workaround of using required: false instead of short hand notation helps. Good with that for now.
In the reproducer project shared below, the request contains a trait named paginationParameters. It has two optional queryParameters and they do not appear in the generated code. But the other metaQuery also has queryParameters which appear in the code even if they are made optional.
Please try different iterations in the reproducer project and identify the issue.
https://github.com/techpavan/springmvc-raml-plugin-issues/tree/master/1