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

typegen issue with crux_http 0.7.0 #206

Closed
andrewweston opened this issue Feb 22, 2024 · 4 comments
Closed

typegen issue with crux_http 0.7.0 #206

andrewweston opened this issue Feb 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@andrewweston
Copy link
Contributor

I get the following error when generating types after upgrading to crux_http 0.7.0:

--- stderr
Error: type tracing failed: Not supported: deserialize_any:

An unsupported callback was called during (de)serialization tracing. In practice, this happens when an
unsupported Serde attribute is used. Attributes specific to self-describing formats (JSON, YAML, TOML)
are generally not supported. This includes: `#[serde(flatten)]`, `#[serde(tag = "type")]`, 
`#[serde(tag = "t", content = "c")]`, and `#[serde(untagged)]`.

I can trace it to the A::Capabilities::register_types(self) method but haven't had the time to dig further into it (yet).

Upgrading the counter example to use 0.7.0 gives the same issue.

I'm happy to pursue if the answer isn't immediately obvious.

@charypar charypar added the bug Something isn't working label Feb 23, 2024
@charypar
Copy link
Member

Oof, sorry about that, I'll have a look at fixing it later today. It'll have something to do with the types introduced to the http capability protocol.

@charypar
Copy link
Member

#207 should fix this problem. It does for the counter example. We'll release it later.

@charypar
Copy link
Member

@andrewweston This should work with crux_http 0.7.1 again. Note that you need to add a line to trace the HttpError type like this:

gen.register_type::<HttpError>()?;

We'll be revisiting how typegen works to avoid these sorts of problems in the future (there's a tracking issue for that: #145)

@andrewweston
Copy link
Contributor Author

Perfect, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants