Forum Discussion

MeltingMosaic's avatar
MeltingMosaic
Occasional Contributor
8 years ago
Solved

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

 

 

 

  • fehguy's avatar
    fehguy
    8 years ago

    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!

4 Replies

  • 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!

    • MeltingMosaic's avatar
      MeltingMosaic
      Occasional Contributor

      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.

      • fehguy's avatar
        fehguy
        Staff

        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!