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

Parameter to override a field type on a per-language basis #119

Merged
merged 4 commits into from
Jun 17, 2023

Conversation

snowsignal
Copy link
Contributor

Resolves #22.

There is now a field decorator that can override the type of the field in the generated language(s) of your choice. This override takes precedent over everything else, including type mapping.

@snowsignal
Copy link
Contributor Author

This PR depends on #118.

@snowsignal snowsignal force-pushed the jane/annotations/override-type branch from 7da1dd6 to 8dbb705 Compare May 19, 2023 20:20
@Lucretiel Lucretiel self-assigned this May 25, 2023
@Lucretiel
Copy link
Contributor

General questions:

  • Is this the first typeshare attribute (aside from the top-level one)?
  • Is there an assumption here that the types should be compatible without any additional (de)serialize logic, in either direction, in either rust or the target language?

@snowsignal
Copy link
Contributor Author

General questions:

* Is this the first `typeshare` attribute (aside from the top-level one)?

* Is there an assumption here that the types should be compatible without any additional (de)serialize logic, in either direction, in either rust or the target language?
  • No, we already have field decorators like #[typeshare(typescript(readonly))].
  • Correct, we don't check for compatibility. That's the responsibility of the end-user (given that this is usually a last-resort option)

@snowsignal snowsignal requested a review from Lucretiel May 26, 2023 00:06
@Lucretiel Lucretiel force-pushed the jane/annotations/override-type branch from 8ad8b90 to 0d3ae17 Compare June 17, 2023 00:26
@Lucretiel Lucretiel force-pushed the jane/annotations/override-type branch from 0d3ae17 to f815982 Compare June 17, 2023 00:59
@Lucretiel
Copy link
Contributor

Slightly screwed up merging #118 so I force-rebased this branch. Merge should be fine.

@Lucretiel Lucretiel merged commit 913c5c2 into main Jun 17, 2023
6 checks passed
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.

Macro params to override generated type
2 participants