Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: type object 'MyType' has no attribute '_serialized_on_wire' #26

Closed
jeremyjjbrown opened this issue Mar 25, 2020 · 1 comment

Comments

@jeremyjjbrown
Copy link

jeremyjjbrown commented Mar 25, 2020

Typing to dump my structure to a dict for validation and I get

AttributeError: type object 'Emi3LocationInfoType' has no attribute '_serialized_on_wire' 
.venv/lib/python3.8/site-packages/betterproto/__init__.py:732: AttributeError

Here is the generated class

@dataclass
class Emi3LocationInfoType(betterproto.Message):
    """
    Contains full location information about station: name, description, type,
    timezone, address, coordinates, owner.
    """

    # Geographical coordinate information giving the precise location.
    geo_coordinate: "Emi3GeoCoordinate" = betterproto.message_field(1)
    # Detailed address of the location.
    address: "Emi3AddressType" = betterproto.message_field(2)
    # Official name of the location.
    name: "Emi3MultilingualText" = betterproto.message_field(3)
    # Location owner name.
    property_owner: "Emi3MultilingualText" = betterproto.message_field(4)
    # Geographical coordinate for parking entrances. This field should be omitted
    # if a separately identifiable parking entrance does not exist or the
    # entrance is the same as the location of the charging station.
    parking_entrance_geo_coordinate: "Emi3GeoCoordinate" = betterproto.message_field(5)
    # Specific details about the surrounding environment (restriction).
    description: "Emi3MultilingualText" = betterproto.message_field(6)
    # The general type of the charge point location, like onstreet, underground
    # garage etc.
    location_type: "Emi3LocationInfoTypeEmi3LocationTypeEnum" = betterproto.enum_field(
        7
    )
    # The time zone of the location.
    time_zone: "Emi3TimeZone" = betterproto.message_field(8)
@jeremyjjbrown
Copy link
Author

jeremyjjbrown commented Mar 25, 2020

Please close. This is my error.

@cetanu cetanu closed this as completed Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants