Skip to content

Question: struggling to understand type.go #71

Open
@fredbi

Description

@fredbi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions