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

Include protocol defined errors in schema serialization #263

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

masad-frost
Copy link
Member

@masad-frost masad-frost commented Aug 24, 2024

Why

The "built-in" errors can be emitted by any procedure, we should include them in our serialized format so that we don't have to merge them in everywhere that consumes serialized schema for codegen

What changed

All serialized procedures now include protocol errors

Versioning

  • Breaking protocol change
  • Breaking ts/js API change

@masad-frost masad-frost requested a review from a team as a code owner August 24, 2024 01:33
@masad-frost masad-frost requested review from jackyzha0 and removed request for a team August 24, 2024 01:33
@masad-frost
Copy link
Member Author

masad-frost commented Aug 24, 2024

Current dependencies on/for this PR:

This comment was autogenerated by Freephite.

@@ -431,16 +435,11 @@ export class ServiceSchema<
{
init: Type.Strict(procDef.requestInit),
output: Type.Strict(procDef.responseData),
errors: getSerializedProcErrors(procDef),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@masad-frost masad-frost changed the title Include protocol defined errors in schema Include protocol defined errors in schema serialization Aug 26, 2024
@masad-frost masad-frost force-pushed the 08-23-Disallow_union_of_code_in_BaseErrorSchema branch from a7a5d5a to b8a4f66 Compare August 26, 2024 17:32
@masad-frost masad-frost force-pushed the 08-23-Include_protocol_defined_errors_in_schema branch from a92b4c7 to 237d890 Compare August 26, 2024 17:32
Base automatically changed from 08-23-Disallow_union_of_code_in_BaseErrorSchema to main August 26, 2024 22:19
@masad-frost masad-frost force-pushed the 08-23-Include_protocol_defined_errors_in_schema branch from 237d890 to 129cea7 Compare August 26, 2024 22:19
@masad-frost masad-frost merged commit ea16d3f into main Aug 30, 2024
4 checks passed
@masad-frost masad-frost deleted the 08-23-Include_protocol_defined_errors_in_schema branch August 30, 2024 19:07
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