A baby or toddler sleeping in just a diaper is just fine.
My nephew when he was a baby always slept in just a diaper during the warmer months or summer when he was an infant and continued to sleep in just a diaper until he was potty trained both day and night at age 4.
If it's cold out you should keep the infant or toddler in some pajamas to keep them warm and if it's a toddler they can have a blanket on them.