MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / schemaXOrder

Function schemaXOrder

pkg/codegen/utils.go:385–407  ·  view source on GitHub ↗
(v *openapi3.SchemaRef)

Source from the content-addressed store, hash-verified

383}
384
385func 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
410func SortedSecuritySchemeKeys(dict map[string]*openapi3.SecuritySchemeRef) []string {

Callers 1

SortedSchemaKeysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…