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

kotlin.NotImplementedError #69

Open
hguercan opened this issue Mar 13, 2024 · 4 comments
Open

kotlin.NotImplementedError #69

hguercan opened this issue Mar 13, 2024 · 4 comments

Comments

@hguercan
Copy link

hguercan commented Mar 13, 2024

Hello,

I am receiving for one event validation following error

kotlin.NotImplementedError: An operation is not implemented: something went wrong: com.github.erosb.jsonsKema.MarkableJsonObject@13b61e54 vs {
"feature": "some-val",
"element": "some-val",
"action": "some-val"
}

at com.github.erosb.jsonsKema.AggregatingValidationFailure.join$json_sKema(ValidationFailure.kt:67) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator.accumulate(Validator.kt:711) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator.accumulate(Validator.kt:156) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.SchemaVisitor.visitCompositeSchema(SchemaVisitor.kt:71) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator.access$visitCompositeSchema$s680550253(Validator.kt:156) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator$visitCompositeSchema$2.invoke(Validator.kt:259) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator$visitCompositeSchema$2.invoke(Validator.kt:258) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator.withOtherInstance(Validator.kt:352) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator.visitCompositeSchema(Validator.kt:258) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator.visitCompositeSchema(Validator.kt:156) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.SchemaVisitor.internallyVisitCompositeSchema$json_sKema(SchemaVisitor.kt:55) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.CompositeSchema.accept(Schema.kt:26) ~[json-sKema-0.13.0.jar:na]
at com.github.erosb.jsonsKema.DefaultValidator.validate(Validator.kt:249) ~[json-sKema-0.13.0.jar:na]
at com.bonial.tracking.trackingpolicing.service.SchemaValidator.validate(SchemaValidator.java:79) ~[classes/:na]
--> rest i cutted 

Tried to debug through the code and I relly cant find the issue.
Using Java 11, json sKema 0.13.0 and also set the kotlin version to 1.9 in my pom.

Is there anything I can do?

@hguercan
Copy link
Author

Probably I found the cause:

My event / schema has the name ui_interaction and there is one property called ui_interaction_details. When the json comes with that property the above error occurs. If i remove it, the library works as usual/expected.

@erosb
Copy link
Owner

erosb commented Mar 13, 2024

Hello Hasan, can you please share

  • the json schema
  • the complete json instance which you validate
  • and the java/kotlin code
  • the library version you use?

Thank you

@hguercan
Copy link
Author

Dear Bence,

Due to sensitive data I cant share it in the first place. For now I needed to solve it very fast but once I find the time I will prepare a dummy dataset to reproduce that error so I can contribute also to improve the library.

However my best guess is: if the parent schema id is a substring of a reference schema id and there are validation errors then this error occurs.

Thanks for your great work so far.
Best Hasan

@erosb
Copy link
Owner

erosb commented Mar 14, 2024

Thank you @hguercan , I appreciate if you spend time on providing a proper reproducer. I couldn't reproduce this so far, but if this problem happens, it can reveal a deep design issue in the validation, so I'm looking forward fixing this.

erosb added a commit that referenced this issue Jun 15, 2024
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

No branches or pull requests

2 participants