-
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
Overriding Models data types not working #359
Comments
You're missing one line:
This will stick the override converter in the front of the chain (the true param does that). You'll get the right results. |
please reopen if you're still having an issue with this. |
@fehguy I am using Swagger on Spring MVC , where do I need to add a custom converter to the Model Converters , I mean where in SwaggerConfig class?? |
@sameer11sep - I assume you're using swagger-springmvc. In that case, you should open an issue on their repository and ask there directly. |
thanks @webron, I have opened an issue at swagger-springmvc , one small question though |
There are several places it can be used, and I'm not sure if swagger-springmvc uses it as well or has another way of registering converters. |
I am passing javax.json.JsonObject as a parameter. But each one has different schema. How can I handle this? In UI, I can just see DataType as javax.json.JsonObject but I want to show proper schema. Can any one please guide me? |
@pradeepg-telsiz - I'd suggest opening a new issue or rather send an email to the mailing list describing your use case. |
@webron Created issue. Issue number is 896. |
The post was helpful and pointed me to the right direction... Although, a quick question relating to Convertors, if someone can comment. When I define my convertor for "ZonedDateTime" for the properties "lastLogin" and "createdOn" properties (to String) using exactly the same pattern (as shown above for java.util.Calendar), the Swagger-UI response-model json schema-representation shows up like below: The question I have is -- How can I avoid having the "value" sub-property in this json representation for the two ZonedDateTime fields. I am expecting the representation to be like below, is there something I am missing ? { |
@mfarhans How did you solve this. Could you post a sample. |
Hi @nikhilingole please reopen if the response in the google group doesn't help you solve your issue. |
I have a very simple model with a java.util.Calendar property, I want to present this as a simple string with date as a format (Similar to what we get with java.util.Date).
I tried what we have in the documentation https://github.com/wordnik/swagger-core/wiki/overriding-models#in-java-with-swagger-core-version-13x
... But it didn't work
My converter looks like this
I'm initializing the converter using Spring, I wonder if that's sufficient and if it is, why is not working.
The text was updated successfully, but these errors were encountered: