samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.71k stars 87 forks source link

Is there an reason to `config.swagger.decompose` defaults to false? #943

Open hikinine opened 2 days ago

hikinine commented 2 days ago

Greetings, amazingg library. I am using combined with Orval which takes que generated openapi json and convert into react-query

Anyway, i was supposed to drop the library because the only way i found (before hear about decompose option) to "properly" use @TypedQuery was replacing via script the generated openapi.json.

Diving on docs, i was not able to find any reference to "decompose". luck for me, i was looking old issues and found https://github.com/samchon/nestia/issues/612 which was exactly what I need.

OPTION 1 (default)

image

OPTION 2 (desired)

image

I am 100% sure that exists an usecase where people would prefer option 1. I just dont think it should be an default option. Am I wrong?

Thanks in advance

samchon commented 2 days ago

I had configured it to false because the query parameter name can be duplicated with path parameter name.

If you have other insight, then tell me please. Changing the default value is not hard thing.

samchon commented 2 days ago

Also, I'll enhance the document at next week.

hikinine commented 2 days ago

Duplicated param/query may be a valid concern. I'm not in a position to evaluate whether defaulting to true is the best option, as I don't know the exact side effects.

Anyway, If no one has bothered with this yet... Enhance and highlight it to docs may be enough.

Again, amazing lib