How can I generate model with exported model validation methods? #2715
-
I have swagger.yaml like
When I generate model with
I need to access validateFirstName method from outside to model file but validateFirstName method is unexported. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We don't export those fields but field validations stop on the first error for a single field. The validation errors have the field name so you can still return the error for a single field. https://github.com/go-openapi/errors/blob/3d13832e1baddf2d1ed8c410165cb39946f2eeef/headers.go#L26 |
Beta Was this translation helpful? Give feedback.
We don't export those fields but field validations stop on the first error for a single field. The validation errors have the field name so you can still return the error for a single field.
https://github.com/go-openapi/errors/blob/3d13832e1baddf2d1ed8c410165cb39946f2eeef/headers.go#L26