Function AppProvider

  • Load an OpenAPI spec and provide the derived app model to the tree.

    On mount (and whenever specConfiguration.specUrl changes) it:

    1. Loads the spec (loadSpec).
    2. Validates it (validateSpec), collecting errors and warnings.
    3. If there are no errors, builds resources (buildResourceConfigs), applies per-resource fieldTypes overrides, and initializes the shared axios client via initApi(baseApiUrl, getToken).

    It also derives authConfig (from securitySchemes.bearerAuth x-* extensions) and profileOperations (operations flagged x-profile: true), and exposes everything through AppContext for useAppContext, Admin, and ProfileRoutes.

    Notes:

    • Must wrap any component that uses useAppContext, Admin, useResource or the profile screens.
    • Base API URL precedence: specConfiguration.baseApiUrl, then the spec's first servers[].url.

    Props: specConfiguration (see SpecConfiguration) and children.

    Parameters

    • __namedParameters: AppProviderProps

    Returns FunctionComponentElement<ProviderProps<null | AppContextValue>>

    <AppProvider specConfiguration={{ specUrl: "/openapi.json" }}>
    <Admin basePath="/admin" />
    </AppProvider>