Skip to content

ModelConverterRegistrar should care the order #2704

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
abccbaandy opened this issue Sep 12, 2024 · 3 comments
Closed

ModelConverterRegistrar should care the order #2704

abccbaandy opened this issue Sep 12, 2024 · 3 comments
Labels
invalid This doesn't seem right

Comments

@abccbaandy
Copy link

Is your feature request related to a problem? Please describe.

I got the oneOf property is not work issue, but no fix yet.
swagger-api/swagger-core#4732

In the meantime, I am working on my own ModelConverter to hack the result.
I use this code to add my converter.

        ModelConverters.getInstance().addConverter(new MyCustomResolver());

But I found the Springdoc have its own converter too, and it overwrite my result.
I think the reason is because the order of the converters in ModelConverters.

Describe the solution you'd like
Maybe just use Spring @Order annotation?

@bnasslahsen
Copy link
Collaborator

@abccbaandy,

The addConverter method is in swagger-core project. It adds elements to CopyOnWriteArrayList which maintains the order of elements

@bnasslahsen bnasslahsen added the invalid This doesn't seem right label Sep 23, 2024
@abccbaandy
Copy link
Author

@bnasslahsen ,
But I don't find any elegant way to change the order.
The api is not powerful like HttpSecurity.addFilterBefore
Any workaround to this issue?

@bnasslahsen
Copy link
Collaborator

@abccbaandy,

This is a question for swagger-core team.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants