-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor: Introduce OntologyService and refactor resource creation #3255
Conversation
case Some(_: ApiV2Schema) => true | ||
case _ => false | ||
}) | ||
iriInfo.iriType == KnoraDefinitionIri && iriInfo.ontologySchema.isInstanceOf[ApiV2Schema] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this precise? It's always going to be an instance of Option first, ApiV2Schema second. It's never a good idea to use isInstanceOf, it's not type safe, as you see here. If you're interested in the subtype, add WithAsIs and use .contains(_.is[ApiV2Schema])
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right... that's actually not at all correct, I completely ignored the option. That may be the reason why suddenly all the tests fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted the change which fixed the tests.
I don't think I want to spend anymore time on this PR, so I leave WithAsIs for another time.
Pull Request Checklist
Task Description/Number
Issue Number: DEV-
PR Type
Basic requirements for bug fixes and features
Does this PR introduce a breaking change?