Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Bug (?) and/or feature request: Violations are thrown for event properties not matching the case defined in the tracking plan #272

Open

Description

@cjhensen

Hello Segment team!

We have a tracking plan where we define event properties using snake_case. When using the nice-property-names: true option in typewriter.yml, a property such as account_id gets transformed to accountID. This is fine, aside from the fact that when an event is called with that property name, it will always throw a violation because it doesn't match the snake case property. Not sure if this is a bug or not.

If it's not a bug, I'd like to suggest this feature:
Add a new option to the typewriter.yml that allows for conversion of property names back to JSON. If you specify the option just-types: false, then a nice Convert class is generated in the output code. However, they can't be used in combination with the generated track functions because the types won't match up. If there was an option to convert back to JSON before the event is sent to Segment, then there wouldn't be violations in this case.

Activity

  1. oscb commented on Dec 14, 2022

    @oscb
    Contributor

    Hi @cjhensen

    I confirmed this is happening and it is a bug. This one might be a tricky bug to fix as we the nice-property-names options comes directly from the Quicktype library we use for generating the types in each language (same for the handy conversion functions).

    I agree on your solution, the right way would be to convert the classes back to JSON and then then send those. The tricky part however will be to actually map these conversions to each type, we will have to delve for a while in Quicktype's internals to find the right way to do so.

    Sorry for not having a better solution, but for now I think the best is to stick to the names as they are in defined in the the tracking plan to prevent issues. For now I'm going to have to turn off the nice-property-names options while we work on a better solution.

  2. added
    bug
    on Dec 14, 2022
  3. cjhensen commented on Dec 22, 2022

    @cjhensen
    Author

    Hi @oscb! Apologies for my delay in response here. I appreciate you confirming the bug. We are going to stick with the property names as defined in the tracking plan for the time being while this bug is open. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions