Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to detect spec version optionally #646

Conversation

valfirst
Copy link
Contributor

@valfirst valfirst commented Feb 1, 2023

There could be cases when schemas are managed by third-parties, in this case client side logic can either use spec version defined in schema if available or some default one. Having current implementation of SpecVersionDetector it's not really convenient to catch exception to fallback to some default value then. Also exceptions are quite heavy mechanism, thus new method is proposed which returns an empty Optional value, if the schema tag is not present.

Also small refactoring of SpecVersionDetector class is done in order to make it true-utility class:

  • class is marked as final
  • private constructor is added

@stevehu stevehu merged commit b1aec99 into networknt:master Feb 2, 2023
@stevehu
Copy link
Contributor

stevehu commented Feb 2, 2023

@valfirst Thanks a lot for your help.

@valfirst valfirst deleted the add-ability-to-detect-spec-version-optionally branch February 3, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants