-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
@ApiModelProperty(dataType='xx') not handled within ModelPropertyParser #334
Comments
There seems to be similar problem with the "notes" field in the same annotation. |
@andyoll the issue you are hitting is that I will look at the datatype mapping, that should still work. |
This also doesn't work in Java. The dataType parameter of @ApiModelProperty appears to have absolutely no effect at all in both versions 1.3.1 and 1.3.2. I've tried annotating a property like such: @ApiModelProperty(required = true, position = 1, dataType = "java.lang.Long")
public String getId ()
{
return m_id;
} ...but the model still defines "id" as type "string" |
This is still an issue with 1.3.2, as stated above. |
Hi, I think the right thing to do is map java.util.Collection to type List in an override converter so it can be treated as such. There should be examples on the wiki to do so. |
thanks, I will try that, but is there a reason why TypeUtil.scala doesn't
|
No, as i mentioned it's simply not implemented. Collections should be converted into a List type. Happy to merge a PR on this. |
I will try to make a PR for the patch I made, just need to verify it som more... In the mean time: OverrideConverter converter = new OverrideConverter();
converter.add("java.util.Collection", "java.util.List"); But that doesn't work as the second argument needs to be JSON. |
Added a pull request for this: #506 |
I just ran into what rage-shadowman described above in java as well. I can't set dataType="string" for uuid field types. |
Same thing here. dataType="x" doesn't seem to have any effect at all in Java. Any updates? |
Hi @Lorkster this enhancement is in progress but not complete. Will be in 1.3.6-SNAPSHOT shortly. |
This bug is still present in 1.3.10 it seems, event though the change request was merged. Has it been removed again? |
In version 1.2.5 it was possible to annotate a case class as:
The dataType attribute would be processed correctly, and Option[Long] would not be described in Swagger doco as 'Object'. This seemed like a reasonable work-around for describing Option[xx] dataTypes.
In 1.3 I've migrated to:
But now dataType has no effect. The resulting JSON for field id:
Although I can see that ModelPropertyParser$.processAnnotations does extract dataType value and return it, this value is never used in ModelPropertyParser$.parsePropertyAnnotations.
The text was updated successfully, but these errors were encountered: