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

Validate xml against xsd #5

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Validate xml against xsd #5

merged 3 commits into from
Jan 16, 2024

Conversation

noplisu
Copy link
Collaborator

@noplisu noplisu commented Jan 15, 2024

Pull Request Summary

To make sure that the xml we are generating is valid we want to validate it againts the provided xsd. This will also make it simpler to find changes if the KSeF API changes. To validate the xml we will be using go-xsd-validate package. To make the invoice valid we remove ExchangeRate, FP, TP fields until we are able to populate them with correct values.

To make sure that the xml we are generating is valid we want
to validate it againts the provided xsd. This will also make
it simpler to find changes if the KSeF API changes.

To validate the xml we will be using go-xsd-validate package
so we add it into the project. We also use this opportunity
to do a little cleanup and remove all not used packages.
There are some optional fields in our current invoice that are
being left empty. This creates an invoice that is not valid
and will not be accepted by the KSeF API.

To make the invoice valid we remove ExchangeRate, FP, TP fields
until we are able to populate them with correct values.
To make sure that the xml we are generating is valid we
check it againts a xsd file. We add the current FA2 version
of the xsd. This will allow us to validate our invoice for
any new version of KSeF.
Copy link
Contributor

@samlown samlown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@noplisu noplisu merged commit 93bc307 into main Jan 16, 2024
2 checks passed
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