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

JSON and XML Validation #73

Closed
gverran opened this issue Jan 24, 2023 · 1 comment
Closed

JSON and XML Validation #73

gverran opened this issue Jan 24, 2023 · 1 comment
Labels
wontfix This will not be worked on

Comments

@gverran
Copy link

gverran commented Jan 24, 2023

I do understand that content validation is not performed based on your documentation, not to mention that unknown elements are simply dropped.

Is it possible to add validation so that if for instance, JSON or XML is parsed that contains elements that do not match the given message type and version, that a suitable error can be thrown?

For instance, a JSON ISO-20022 message whereby the field names started with capital letters was not thrown out, but the fields simply thrown away. It would be beneficial that when invalid data is sent, that a suitable error is thrown back so that integrators can assess and correct the error. This will ensure that good structured data is sent and that errors are not swept under the carpet.

@zubri zubri added the wontfix This will not be worked on label Mar 7, 2023
@zubri
Copy link
Member

zubri commented Mar 7, 2023

Thanks for the feedback, however for several reasons this not within the scope of the library.

I suggest you get the corresponding XSD schemas and you apply a validation of the XML payload against the schema yourself. As a decoupled process of the unmarshalling into the model.
The model is intended to facilitate consumption of the XML data from plain Java DTOs. And to do enrichment or modification of the content before marshaling that back into XML.

@zubri zubri closed this as completed Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants