You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if a swagger is missing a space in "type: string" and is written "type:string"
swagger generate server produces "json: cannot unmarshal string into Go struct field SwaggerProps.definitions of type struct { spec.SchemaProps; spec.SwaggerSchemaProps }"
Something like
"Missing space in 'type:string' would be a better error message
Yes, the validator first unmarshals the spec and there is no attempt to keep the full context of the unmarshaling error.
This is another instance of old issues #1425 and #1308. Basically, this was the intent with #121, and we never completed it.
This kind of improvement (most likely in go-openapi/validate) would be indeed welcome.
Problem statement
if a swagger is missing a space in "type: string" and is written "type:string"
swagger generate server produces "json: cannot unmarshal string into Go struct field SwaggerProps.definitions of type struct { spec.SchemaProps; spec.SwaggerSchemaProps }"
Something like
"Missing space in 'type:string' would be a better error message
Swagger specification
Steps to reproduce
swagger generate server
Environment
swagger version: v0.25.0
go version: 1.14.2
OS: Ubuntu 18.04.4 LTS
The text was updated successfully, but these errors were encountered: