Long vowels are very important in Japanese. So in okashi it's a short i at the end while okashii has a long i at the end. Note, long vowels in Japanese doesn't mean they sound different like in English, it just means they're held for a little bit longer.
One good example is:
koko - with two short Os means "here"
kōkō - with two long Os means "high school" (this can also be romanized like koukou, with Us to indicate the long O)