Forum Discussion

paulj992's avatar
paulj992
New Contributor
2 years ago

How to use Swagger Editor generated .json file in a .NET app

So I've used Swagger Editor to write API documentation, exported it to a JSON (and YAML) file, but how can we use that file as the API documentation in our .NET Core app?  We've been using the Swashbuckle package and attributes on classes/methods so that Swagger will generate the documentation, and that works fine.  But we would like to replace the generated doc with the better documentation created with Swagger Editor...

Thanks,
Paul

1 Reply

  • paulj992's avatar
    paulj992
    New Contributor

    Short answer to my own question: you can't do that...  SwaggerHub is great for defining an API, etc., but you cannot really use the YAML definition as documentation within your own app (you can export HTML, etc., but then that has to be hosted with all the corresponding generated files, which is not really feasible from an automated CI/CD perspective).   You can host the documentation on SwaggerHub and provide a link to it, so that is about the best option for us.