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:
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:
- enable xml documentation related projects (refer here)
- 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.
- 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
Post a Comment