swagger-angular-generator icon indicating copy to clipboard operation
swagger-angular-generator copied to clipboard

Added support for enum definitions. Improves usage of reusable enums.

Open wvpelt opened this issue 7 years ago • 5 comments

I have added the generation of enum definition types. Empty files were generated for enum types.

wvpelt avatar Nov 16 '18 14:11 wvpelt

Thank you for the PR!

Please add a suitable example to the demo-app/client/swagger-files/unit-test-swagger.json and generate the test files. Thanks!

fazpu avatar Nov 21 '18 10:11 fazpu

Thank you for the PR!

Please add a suitable example to the demo-app/client/swagger-files/unit-test-swagger.json and generate the test files. Thanks!

@fazpu, @jnwltr I extended the UserDetails definition with gender as an example enum in the demo-app. Is it possible to review? Thanks.

yluijten avatar Mar 08 '19 09:03 yluijten

@fazpu Is it possible to merge this?

wvpelt avatar Jun 19 '19 09:06 wvpelt

I have some issues with this fork compared to v4.1.0. Other than the enums, it renames some methods, such that they conflict. I have the GET methods approval and approval/count, before the generated names were approval and count. Now they are both getItems, which they share in the OpenApi definition, but no good to use due to conflict. Maybe the path could also conflict, in which case the naming strategy should look at both.

Also, for the enums, you can simply cast them as const instead of the enum type. This give them stricter type safety with less effort.

KnutRyagerInmeta avatar Oct 31 '19 12:10 KnutRyagerInmeta

@wvpelt sorry for making you wait so long, and thanks a lot for the PR. Anyway, if you were able to rebase, I would do the review and merge in a few days. Thanks.

jnwltr avatar Nov 15 '19 14:11 jnwltr

Hi, we are closing this PR because rebase was not done.

petrhavel2 avatar Nov 20 '23 14:11 petrhavel2