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

Page<T> where T: Encodable does not seem to be allowed to be extendable #548

Open
jcbriones opened this issue Feb 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jcbriones
Copy link

Describe the bug

Not sure if this is really a bug but I'm trying to extend the Page struct from FluentKit on my project and it's saying that the T is not conforming to Encodable but it seems it is extending the Page to Encodable. I am guessing it migh be because the extension was internal and not set to public? This is the error I am getting
image
Type 'T' does not conform to protocol 'Encodable'

To Reproduce

Steps to reproduce the behavior:

  1. Create a protocol and inside the protocol to use the page's items.
  2. Create an extension for Page that uses the protocol
  3. You'll get the error that T is not encodable.

Expected behavior

That T is encodable even when used in an extension.

Environment

  • Vapor Framework version: 4.69.2
  • Vapor Toolbox version: Not installed
  • OS version: MacOS 13.2

Additional context

You can message me directly if you'd like to do one on one to figure out the issue.

@jcbriones jcbriones added the bug Something isn't working label Feb 8, 2023
@jcbriones
Copy link
Author

Just realized that T does not conform to Encodable or Decodable. It's just an extension where T is encodable or decodable. Is there a reason why T does not directly conform to codable?

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

1 participant