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

Fix #89: #[derive(Schema)] for StructVariants #134

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

barafael
Copy link

@barafael barafael commented Apr 1, 2024

Here comes a 4-commit sandwich.

The actual issue I believe is fixed with this. However, there are 2 open questions regarding the schema tests (see commit message bodies):

  • Where should the schema tests be located? As of now, they force the schema module to be public because they are integration tests. A doc comment above mod schema; explicitly says not to make experimental features pub 😆
  • The test for struct serialization does not pass. It seems it wants the array member to be schematized as a Seq, but the array member is schematized as a 10-element Tuple.

Let me know what you think :) I love using this crate.

It seems they were guarded under an invalid feature name.
Also, they are located with the integration tests for postcard, but the schema module is not publicly visible, so they don't compile.
I switched it to public (for now).
Not sure if the test was wrong or the serialization is wrong.
For now, I'm after jamesmunns#89, so I'll just make the test green to see if my changes break anything.
Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for cute-starship-2d9c9b canceled.

Name Link
🔨 Latest commit 14a2f4c
🔍 Latest deploy log https://app.netlify.com/sites/cute-starship-2d9c9b/deploys/661290849de9f00008f57148

@jamesmunns
Copy link
Owner

Hey @barafael, overall looks good!

  1. can we use the scoped/conditional exports, e.g. postcard::experimental::schema instead of making postcard::schema public? If not, could you please slap it with a #[doc(hidden)] and a comment that says "this isn't API stable, just an impl detail"?
  2. Re: 5d0e703, I dunno, I'll have to look, that looks very seq-y to me.

Thanks!

@barafael
Copy link
Author

barafael commented Apr 7, 2024

1.: maybe a simple conditional pub is good enough?

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.

None yet

2 participants