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

Cannot use types that extend Map or Collection as response #571

Open
markvogelnomad opened this issue Feb 1, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@markvogelnomad
Copy link

Describe the bug
Whenever using a type that extends Map or Collection but doesn't pass through the generic type parameters as a response we get an error from the arguments.first() call because the arguments are empty.

The easiest examples of this are JsonObject and JsonArray from Kotlinx Serialization. Even though the object is fully serializable, Kompendium doesn't seem to use that data.

To Reproduce
Use JsonObject as a response parameter or create an example class Foo : List<Bar> and use it as the response.

Expected behavior
The definition of the response object should be generated based off the serialization data or search the hierarchy for the types if that's not possible.

Screenshots
image

@brizzbuzz
Copy link
Contributor

yea this makes sense... should be a pretty easy fix, just need to modify the type detection to check if a type extends collection or map and then treat it accordingly.

Would appreciate a pr for this if you have time :)

But, just so you're aware, somehow the sonatype integration is broken (see #568) and I'm not clear on when I'm going to have time to figure out whatever the heck is wrong with maven central this time... so publishing of kompendium versions is in a bit of a freeze

@brizzbuzz brizzbuzz added the bug Something isn't working label Feb 1, 2024
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