Mongo ObjectId in swagger api-docs url

1,862 views
Skip to first unread message

assaf.k...@teamaol.com

unread,
Jul 19, 2016, 2:16:57 PM7/19/16
to Swagger
Hello All
One of the fields in my DTO object is Mongo ID ObjectID
problem is that api-docs url renders it as following
 "companyId": {
    "counter": 0,
    "date": "2016-07-19T18:14:15.953Z",
    "machineIdentifier": 0,
    "processIdentifier": 0,
    "time": 0,
    "timeSecond": 0,
    "timestamp": 0
  }

Why the actual output for the same object is as follows : "companyId": "54c64814e4b0239071c154a1",

How can i match the schema to be present as a simple hash string key

Thanks

Ron Ratovsky

unread,
Jul 19, 2016, 5:28:47 PM7/19/16
to swagger-sw...@googlegroups.com

Which tool do you use to generate the spec? Which version?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

assaf.k...@teamaol.com

unread,
Jul 24, 2016, 10:22:38 AM7/24/16
to Swagger
I use swagger UI annotations 1.5.9

io.swagger » swagger-annotations

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

tony tam

unread,
Jul 25, 2016, 11:33:39 AM7/25/16
to swagger-sw...@googlegroups.com
You can override the converter to turn your Company object into whatever you like.  See here for an example:



To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages