It was taken from [SwaggerSerializers](https://github.com/wordnik/swagger-core/blob/master/modules/swagger-core/src/main/scala/com/wordnik/swagger/model/SwaggerSerializers.scala#L141) to conform reference implementation.