package models

import com.gilt.apidoc.spec.v0.models.Service

/**
  * Given a service, returns a list of all of the imports needed for
  * json serialization/deserialization/
  */
object JsonImports {

  def apply(service: Service): Seq[String] = {
    (
      Seq(s"import ${service.namespace}.models.json._") ++
      service.imports.map { imp =>
        s"import ${imp.namespace}.models.json._"
      }
    ).sorted
  }

}

package models

import generator.Namespaces
import com.gilt.apidoc.spec.v0.models.Service

/**
  * Given a service, returns a list of all of the imports needed for
  * json serialization/deserialization/
  */
object JsonImports {

  def apply(service: Service): Seq[String] = {
    (
      Seq(s"import ${Namespaces(service.namespace).models}.json._") ++
      service.imports.map { imp =>
        s"import ${Namespaces(imp.namespace).models}.json._"
      }
    ).sorted
  }

}

Use namespaces class for imports
Use namespaces class for imports
