none
Swagger Unavailable RRS feed

  • Question

  • I am deploying an API app to my App Service, but when I try to build an API client for it I get an error that it cannot get the metadata file.

    So I logged into the preview portal, and when I look at my API App's API definition I get the following error "Cannot get the API definition. It may require additional configuration or authentication on the API app. Click here to learn more.".

    What is strange is if I pull up my app's swagger url - https://microsoft-apiapp8cb8bf34bd184f5fa00afb9aa5297d79.azurewebsites.net/swagger/ui/index 

    It appears to be valid and I can see all of my controllers and api methods.

    Please advise.

    **Additional Info ***

    So I wiped that deployment and redeployed, and did some additional digging.  It looks like it only likes one of the 4 controllers in the project.  All controllers are very similar, but I went through and deployed with only one controller included in the project and for all but one the API definition was unavailable.  Any help would be appreciated.


    Monday, June 1, 2015 4:56 PM

Answers

  • Figured out my issue, and a work around.

    A few of my objects were designed like this...

    public Class Topic

    {

    public IList<Topic> SubTopics { get; set; }

    }

    Basically any service that interacted with an entity with that type of design would not work.  I put a work around in place, but would kind of like to use that pattern in certain situations so any additional feedback would be appreciated, but can probably close this one out.

    • Marked as answer by cincycentric Tuesday, June 2, 2015 10:48 AM
    Tuesday, June 2, 2015 10:48 AM

All replies

  • Would you be willing to share your project? Maybe via GitHub or some other public repository? I'd like to see it to try to reproduce your issue. Or I'd be willing to take the discussion offline with you via email, then once we figure out the problem we'll update this post? 
    Monday, June 1, 2015 8:39 PM
    Moderator
  • Figured out my issue, and a work around.

    A few of my objects were designed like this...

    public Class Topic

    {

    public IList<Topic> SubTopics { get; set; }

    }

    Basically any service that interacted with an entity with that type of design would not work.  I put a work around in place, but would kind of like to use that pattern in certain situations so any additional feedback would be appreciated, but can probably close this one out.

    • Marked as answer by cincycentric Tuesday, June 2, 2015 10:48 AM
    Tuesday, June 2, 2015 10:48 AM