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

Best Practice Target Capability: Data Type Failsafe #20

Open
aaronsteers opened this issue Oct 1, 2021 · 0 comments
Open

Best Practice Target Capability: Data Type Failsafe #20

aaronsteers opened this issue Oct 1, 2021 · 0 comments
Assignees

Comments

@aaronsteers
Copy link
Contributor

aaronsteers commented Oct 1, 2021

We've run into many, many cases where a specific target receives a JSON schema type that it doesn't expect and then immediately terminates the entire stream.

Rather than failing the sync entirely, we'd like to propose a best practice of always having a failsafe data type which handles two common scenarios:

  1. A catch for parsing exceptions when reading the json schema type. For instance, a $ref or missing properties can cause KeyError during type evaluation. These should be caught and handled with a default type - such as string.
  2. A final else statement at the end of all known cases. Similarly as with the above, if all known cases are evaluated and we've received a type we don't recognize, we should again default to string of similar so that the node's data can still be serialized without terminating the sync.
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

1 participant