c# - Swashbuckle - Add Model and Example values to Swagger UI from a Model from another project -


i using swagger document .net c# api , when models on project swagger crashes , doesn't load anything.

when load sample webapi project visual studio uses models on same project , works:

visual studio sample project example image

but when use models other project crashes before loading anything.

i have api project , business project. models view models stored(and shared among other projects, therfore needed there) on buisiness project.

is there way can indicate swagger model definitions are?

i have handled similar scenario when worked on web api project hosted on iis. required enable xml documentations view models , models 2 different projects.

below summary of main steps of work:

  1. enable xml documentation related projects (refer here)
  2. for each project, build first , include xml file in project. set property of file "copy output directory" "copy newer" ensure copied bin folder of server.
  3. in swagger config, invoke includexmlcomments() include xml documentation files suggested simon88.

the key point ensure xml documentation files copied bin folder of host server , swagger ui knows :-).

by way, there few similar questions/answers kind of issue. 1 here

hope helps.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -