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

Question: struggling to understand type.go #71

Open
fredbi opened this issue Feb 2, 2018 · 0 comments
Open

Question: struggling to understand type.go #71

fredbi opened this issue Feb 2, 2018 · 0 comments
Labels

Comments

@fredbi
Copy link
Member

fredbi commented Feb 2, 2018

Hello.
I am cross-checking schema validations, particularly regarding formatting.

I am struggling to understand the inner workings of typeValidator, and especially the schemaInfoForType() function.

At first glance, it looked to me that this big reflected type switch was very much dependant on strfmt types and should be kept in sync.

Then I realized this type switch can never be fully explored, because schemaValidator replaces any provided struct by its json equivalent (using swag.ToDynamicJSON).

I can see that some old TODOs still remain about handling structs, etc...

Could anyone explain what was the intent with checking all these types here?

It looks like the initial intent was different, could not be completed for some reason, then worked around using JSON.

Thanks

FRED

@fredbi fredbi added the question label Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant