Skip to content

extra causes issue #54

@abhinavdayal

Description

@abhinavdayal

When trying to export models with extra="allow" setting in the config, We get error:

AttributeError: type object 'Config' has no attribute 'extra'

In cli/script.py line 257

After modifying to

# Handle case when config is a Pydantic model's Config class
            if hasattr(config, 'extra'):
                if config.extra != "allow":
                    revert["extra"] = config.extra
                    config.extra = "forbid"  # type: ignore
            else:
                # If `extra` doesn't exist in the `Config`, handle it accordingly
                revert["extra"] = None  # No need to set, just ensure we avoid issues

Makes it to work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions