I want to show:
Let $R$ be a Dedekind domain with fraction field $K$. Let $X$ be a scheme and $X \to \operatorname{Spec}R$ a proper morphism. Show that the natural map $$X(\operatorname{Spec}R)\to X (\operatorname{Spec}K)$$ is a bijection. Here $X(Y):=\text{Hom}(Y,X)$.
I know that if R is a valuation ring, then this is exactly the valuative criterion for properness. So I consider the localization of $R$ at every maximal ideal $m$, try to show that the data of $X(\operatorname{Spec}R)$ is equivalent to the data of $X(\operatorname{Spec}R_m)$ for all $m$ with some conditions. But it seems not so clear.
Any hint or reference would be helpful.