SwagGen icon indicating copy to clipboard operation
SwagGen copied to clipboard

Generator is failing on enums as well.

Open goors opened this issue 5 years ago • 2 comments

I got in swagger like someStatus oneOf SomeStatusEnum but that is generated like someStatus: [String: Any], and that is wrong since SomeStatusEnum can be Active=1, NotActive=0. So imagine I have like tons of that enum dudes and I have to remember all the values instead of saying something like SomeStatusEnum.Active.

So the way this is generated is more of less useless.

goors avatar Dec 30 '19 13:12 goors

Look at the raw request for this:

{"someStatus":{"0":1}}

Instead of {"someStatus":1}

goors avatar Dec 30 '19 17:12 goors

It sounds like you need to be using enum instead of oneOf in your spec. You'll need to provide some more information

yonaskolb avatar Jan 04 '20 13:01 yonaskolb