Update the logic on ref version validation whent patch version is changed
Fix issue Schema validation error for nested $ref in Patch version to allow the version of schema refs to be equal or higher if patch version of the schema is increased.
It also includes some minor refactoring.