yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generator is failing on enums as well.

goors opened this issue · 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.

Look at the raw request for this:

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

Instead of {"someStatus":1}

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

ezoic increase your site revenue