Skip to content

Conversation

maxi297
Copy link
Contributor

@maxi297 maxi297 commented May 26, 2025

What

I was trying to update destination-salesforce and destination-customer-io with the latest changes and the fact that the field for the json schema is called schema clashes with pydantic reserved word schema which has the side effect of having the field named as schema_ instead of schema. This problem occurs in two places:

  • The python code where we need to write schema_ instead of just schema. I’m not too attached to fixing this right now because we were looking into having the destinations in Kotlin but it is bad DX
  • The serialization of the Airbyte message for the discovered catalog generates objects with field schema_ instead of schema and this one is an issue as it does not allow us to return the right object

There are a couple of paths forward I see:

  1. Fix the generation of the python dataclasses to consider the alias: I created a commit from a fork of the repo that generates our dataclasses but I would assume that we would need mode development like a feature switch and I don’t know enough the code so there would be more work here. This would fix both problems but we depend on the repo we use to accept our feature
  2. Keep _schema in Python but fix the serialization as such
  3. Rename schema to json_schema here and avoid the Python dataclass naming project altogether but it’ll require us to update existing code (basically update schema to json_schema

For now, we decided to go with solution 3

@maxi297 maxi297 requested a review from joeykmh May 26, 2025 14:47
@maxi297 maxi297 merged commit 23ef590 into main May 26, 2025
6 checks passed
@maxi297 maxi297 deleted the maxi297/rename-schema-to-json-schema branch May 26, 2025 15:38
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

Successfully merging this pull request may close these issues.

2 participants