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

Clarify Requirements for Schema Validation #20

Closed
JesusMcCloud opened this issue Jun 11, 2021 · 4 comments · Fixed by #31
Closed

Clarify Requirements for Schema Validation #20

JesusMcCloud opened this issue Jun 11, 2021 · 4 comments · Fixed by #31

Comments

@JesusMcCloud
Copy link
Contributor

Currently, both the JVM target and the JS target do not support all JSON schema features.
On JS, schema validation is known to not cover all aspects, on the JVM, further investigation is needed.

@jnischler
Copy link

first of all thanks for your awsome work.
we are currently integrating your libraries into one of our android applications.
integration is straight forward.

But we also stumbled across the this issue.
Using the default code:

chain = DefaultChain.buildVerificationChain(repository)

a validator is created and added to the chain

DefaultSchemaValidationService()

https://github.com/ehn-dcc-development/hcert-kotlin/blob/main/src/jvmMain/kotlin/ehn/techiop/hcert/kotlin/chain/impl/DefaultSchemaValidationService.kt

the validate function always fails and sets the error to:
CBOR_DESERIALIZATION_FAILED

and also hides the exception, I would recommend throwing the exception out of the validator.
I would also recommend changing the error from CBOR_DESERIALIZATION_FAILED to something like SCHEMA_VALIDATION_FAILED.

The validator can't find the file "json/DCC.combined-schema.json".
Also I am unable to provide the file to the validator as i can't find this file ;)

This one is the closest file I could find:
https://github.com/ehn-dcc-development/ehn-dcc-schema/blob/release/1.3.0/DCC.combined-schema.json

For our first test we will create a Chain without a validator or with a very basic validator.

Thanks

@JesusMcCloud
Copy link
Contributor Author

Thanks for the input!
The file is located in src/commonMain/resources
On Android resource loading like done in the code won't work and the schema validation library does not support .getResourceAsStream, which would work on Android.
My bad for not considering Android!
Until there's an official fix, you could replace the schema validation service with a NOOP one on Android.
In addition, logging is already making progress.

@JesusMcCloud
Copy link
Contributor Author

Commits bb1b569 and 3cff16f should address both issues

@jnischler
Copy link

perfect thanks
will run a new test asap

@nodh nodh linked a pull request Jun 22, 2021 that will close this issue
@nodh nodh closed this as completed in #31 Jun 22, 2021
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 a pull request may close this issue.

2 participants