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

fix: correct typo in the validate template for length restrictions #56

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

devzaidi
Copy link
Contributor

Fixes a typo that causes code generation to fail when a length restriction is present in a schema file. Note that this bug was found when attempting to use the project to generate code for a different specification where a length restriction is specified like so:

<xs:restriction base="xs:string">
      <xs:length value="65"/>

To reproduce this, one may paste the lines above into an existing schema file and then attempt to do

make generate

which ultimately fails with this error:

Could not execute template: template: internal/templates/rtp20022/validate.tgo:140:59: executing "internal/templates/rtp20022/validate.tgo" at <.Restriction.MinLength.Value>: nil pointer evaluating *xsd.MinLength.Value

@devzaidi devzaidi requested a review from adamdecaf as a code owner February 11, 2024 11:38
@adamdecaf
Copy link
Member

Thank you for the fix!

@adamdecaf adamdecaf merged commit 5401a7e into moov-io:master Feb 12, 2024
2 of 5 checks passed
@adamdecaf
Copy link
Member

I've cut a release with this fix included - https://github.com/moov-io/rtp20022/releases/tag/v0.10.2

@devzaidi devzaidi deleted the fix/validate-template-typo branch February 13, 2024 04:36
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