schemaType returns the JSON Schema type string for an OpenAPI schema. Defaults to "string" when the type is unspecified.
(s *base.Schema)
| 389 | // schemaType returns the JSON Schema type string for an OpenAPI schema. |
| 390 | // Defaults to "string" when the type is unspecified. |
| 391 | func schemaType(s *base.Schema) string { |
| 392 | if len(s.Type) > 0 { |
| 393 | return s.Type[0] |
| 394 | } |
| 395 | |
| 396 | return "string" |
| 397 | } |
| 398 | |
| 399 | // yamlNodeToValue converts a yaml.Node to a native Go value, preserving the |
| 400 | // original type (int, float, bool, null) instead of returning everything as a |
no outgoing calls
no test coverage detected