How to validate Kubernetes components version?

Hi all!

Is there a way to validate the yaml files to verify if they are using deprecated component versions without I define the validation rules manually ?

Example:
Validation considering Kubernetes v1.22

apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
...

Output: You are using an HPA version (v2beta1) deprecated since Kubernetes 1.19