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

Can't have my model and eat it too :) #86

Open
SJrX opened this issue Jun 27, 2024 · 1 comment
Open

Can't have my model and eat it too :) #86

SJrX opened this issue Jun 27, 2024 · 1 comment

Comments

@SJrX
Copy link

SJrX commented Jun 27, 2024

If you call NewValidator() the resulting validator has the v.document field set. However if I want you call NewValidatorFromV3Model() it doesn't. Without this being set you get a panic when you call ValidateDocument(). I eventually dug into the code, and I found that the v3 Model is cached in the document, so just did that.

It's possible that I'm just missing something obvious with Go, but due to the private access, you can't actually repair the invariant if you try and build it from the model, because the document field is private (as is the type).

@daveshanley
Copy link
Member

There may be a gap in the API here, I will look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants