Hello @sankar_g
Are you following this blog?
http://www.kamilgrzybek.com/design/rest-api-data-validation/
@sankar_g check the below link.
https://magento.stackexchange.com/questions/153244/magento-2-add-custom-product-attribute-validation...
Thanks