Make sure Location, Middleware and MiddlewareSpec implement json.Marshaler interface instead of using Format() function.