Function extractFields

  • Convert an OpenAPI schema's properties into FieldConfig objects.

    Reads the react-openapi spec extensions (x-label, x-description, x-order, x-hidden, x-filterable, x-sortable, x-ui-type, x-upload-url, x-upload, x-autocomplete, x-fk, x-edit-as) and resolves $ref/array-of-$ref/oneOf properties into inline-ref metadata (refSchema, inlineDisplayFormat) or, for discriminated unions, oneOfOptions + discriminatorProperty. Enum values are lifted from array items so arrays-of-enum render as multi-selects. Plain filterable strings default to the "text" autocomplete (with a warning); an x-autocomplete on a non-filterable field records a validation error.

    Parameters

    • schemaName: string

      Schema name (used in diagnostics).

    • schema: any

      The schema object whose properties are read.

    • schemas: Record<string, any>

      The spec's components.schemas (for $ref resolution).

    Returns FieldConfig[]

    The resolved fields, in properties order.