Skip to content

TemplateSyntaxError: Invalid character ('-') in variable name: 'CloudFront-Policy' #1660

Description

@pinguin999

Hi I want to connect some S3 service and the JSON needs Felds with - in the name.

class CookiesSchema(Schema):
    CloudFront_Policy: str = Field(..., alias="CloudFront-Policy")

How can I return {"CloudFront-Policy": "abcde"}

I get this Error:
Error extracting attribute: TemplateSyntaxError: Invalid character ('-') in variable name: 'CloudFront-Policy' [type=get_attribute_error, input_value=<DjangoGetter: CookiesSch...air_Id='KEDIJMZ6J0APU')>, input_type=DjangoGetter]
For further information visit https://errors.pydantic.dev/2.12/v/get_attribute_error

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