-
Notifications
You must be signed in to change notification settings - Fork 77
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
JSON object with inheritance is not rendering the parent object correctly #730
Comments
Hi @fcmdeveloper1 , Can you share the classes that are involved, again so that we can easily reproduce it? An alternative to uploading the code as zip is to fork the repo, create a new branch, edit the example (https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/dtos/ExamplePayloadDto.java ; no need to fix tests or anything like that) and commit&push + open a pr to the repo (or your fork) |
Dear @timonback, please, let me know if i can help or support. My Best Regards |
Hi @fcmdeveloper1, I started looking into and created #745 so that we can look at the same thing together. The code contains two variations - see the commits in the pr
I debugged the output of swagger-parser (which springwolf uses) (excluding the extra field of variation 1, excluding the property in the schema annotation of variation 1). Then 3 fields (eventKey is missing) show up. What do you mean with swagger? springdoc and its ui? |
Dear @timonback, also, i didn't get well what do you mean by code changes for variation1. and for the swagger, yes, i am using springdoc-openapi-ui for the swagger documentation. My Best Regards |
Hi @fcmdeveloper1 Therefore, I suggested the alternatives (variations). Both are shown in the reproduce PR in separate commits: d6690f9 Do the alternatives work for you? Or can you investigate what we need to change in springwolf? |
Dear @timonback,
we can have further discussions if any. thanks a lot My Best Regards |
We discussed, but we do not see another way at this point - besides the 2 offered options. The library Apart from that, one improvement regarding the rendering in |
Dears,
i am not sure if this is the behavior of the library or not, but i can see that if i have an object that inherits from a parent object, not all the parent object fields are generated in the specs, specially if there is a "discriminatorProperty".
also, the above is not rendered unless i included both the discriminatorProperty = "" and allOf = {ParentEventDto.class} in the @Schema field of the child object, and even if i did this inclusion, the UI is not rendered correctly for the child object.(missing a lot of fields)
for swagger, without adding the allOf and discriminatorProperty attributes, everything is working perfectly, which is the expected behavior for both UI and the generated swagger description.
disclaimer, i am using the exact same objects with the same @Schema attributes for both description swagger and Kafkaconsumer
My Best Regards
The text was updated successfully, but these errors were encountered: