cancel
Showing results for 
Search instead for 
Did you mean: 

Codegen not working for my API

SOLVED
Highlighted
Occasional Contributor

Codegen not working for my API

Hi,

 

I'm trying to test out my API, but when I try to create the client SDK, nothing happens when I click one of the menu options. It works fine when I try it for PetStore. My API shows up as valid in the editor.

 

https://app.swaggerhub.com/api/MeltingMosaic/BungieNetProxy/1.0.0

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff

Re: Codegen not working for my API

OK I've forked your API and made one other change.  The enum fix was necessary, but you hit another (different) bug in this version of the codegen.

 

In your "allOf" constructs, you must have the $ref item first in the array.  It's a bug that is fixed in the next release, but it is a requirement to get around it.  When you have the $ref first, it builds and downloads just fine.

 

I've sent you a request to access the fork, please feel free to copy it and update your definition, or just swap the three allOf's.

 

Please report back!

-----
Tony Tam
SmartBear VP of Swagger Products

View solution in original post

4 REPLIES 4
Highlighted
Staff

Re: Codegen not working for my API

Hi, thanks for reporting this.  It looks like the generator is having trouble with your model "MembershipType"--specifically the "enum" value.  There looks to be a bug in the codegen when reading a model which is not type "object" but does have an enum value.  For now, please comment out your "enum [1,2]" and it should generate fine.

 

We'll fix the error reporting and the feature itself.  I hope this helps!

-----
Tony Tam
SmartBear VP of Swagger Products
Highlighted
Occasional Contributor

Re: Codegen not working for my API

Hmm, that didn't seem to work. I edited it and commented out all the enums, but nothing happens when I try to download a client SDK.

Highlighted
Staff

Re: Codegen not working for my API

OK I've forked your API and made one other change.  The enum fix was necessary, but you hit another (different) bug in this version of the codegen.

 

In your "allOf" constructs, you must have the $ref item first in the array.  It's a bug that is fixed in the next release, but it is a requirement to get around it.  When you have the $ref first, it builds and downloads just fine.

 

I've sent you a request to access the fork, please feel free to copy it and update your definition, or just swap the three allOf's.

 

Please report back!

-----
Tony Tam
SmartBear VP of Swagger Products

View solution in original post

Highlighted
Occasional Contributor

Re: Codegen not working for my API

That worked! Thanks!

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors