(v *openapi3.SchemaRef)
| 383 | } |
| 384 | |
| 385 | func schemaXOrder(v *openapi3.SchemaRef) (int64, bool) { |
| 386 | if v == nil { |
| 387 | return 0, false |
| 388 | } |
| 389 | |
| 390 | // YAML parsing picks up the x-order as a float64 |
| 391 | if order, ok := v.Extensions[extOrder].(float64); ok { |
| 392 | return int64(order), true |
| 393 | } |
| 394 | |
| 395 | if v.Value == nil { |
| 396 | return 0, false |
| 397 | } |
| 398 | |
| 399 | // if v.Value is set, then this is actually a `$ref`, and we should check if there's an x-order set on that |
| 400 | |
| 401 | // YAML parsing picks up the x-order as a float64 |
| 402 | if order, ok := v.Value.Extensions[extOrder].(float64); ok { |
| 403 | return int64(order), true |
| 404 | } |
| 405 | |
| 406 | return 0, false |
| 407 | } |
| 408 | |
| 409 | // SortedSecuritySchemeKeys returns sorted keys for a SecuritySchemeRef dict |
| 410 | func SortedSecuritySchemeKeys(dict map[string]*openapi3.SecuritySchemeRef) []string { |
no outgoing calls
no test coverage detected
searching dependent graphs…