7 Answer(s)
-
0
its an error after upgrading to the new aspnetzero version.
in Startup.cs I had:
options.SwaggerEndpoint(_appConfiguration["App:SwaggerEndPoint"], "xxxx API V1"); options.IndexStream = () => Assembly.GetExecutingAssembly() .GetManifestResourceStream("xxxx.xxxx.Web.wwwroot.swagger.ui.index.html"); options.InjectBaseUrl(_appConfiguration["App:ServerRootAddress"]);
but it should be
options.SwaggerEndpoint("/swagger/v1/swagger.json", "xxxx API V1"); options.IndexStream = () => Assembly.GetExecutingAssembly() .GetManifestResourceStream("xxxx.xxxx.Web.wwwroot.swagger.ui.index.html");
-
0
Hi, the configuration
App:SwaggerEndPoint
should be valid.swagger/v1/swagger.json
has moved toappsettings.json
https://github.com/aspnetzero/aspnet-zero-core/blob/b2edfef64f936080e720e78052c61716a7391357/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/appsettings.json#L16
-
0
Should this setting not also be added to the MVC project then ? Since in that project it is also configured in startup.cs as
// Enable middleware to serve generated Swagger as a JSON endpoint app.UseSwagger(); // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.) app.UseSwaggerUI(options => { options.SwaggerEndpoint(_appConfiguration["App:SwaggerEndPoint"], "Portal API V1"); options.InjectBaseUrl(_appConfiguration["App:WebSiteRootAddress"]); }); //URL: /swagger
-
0
you're right. we should provide example for
SwaggerEndPoint
in appsettings.json.See https://github.com/aspnetzero/aspnet-zero-core/pull/2041
-
0
hi, links are not available.
can you share solution again.
-
0
hi again,
in appsettigns.json
"App": { "SwaggerEndPoint": "/swagger/v1/swagger.json", }
and i take "Conflicting schemaIds: Duplicate schemaIds detected for types A and B" error for this issue update statup.cs
{ options.SwaggerDoc("v1", new Info { Title = "YD API", Version = "v1" }); options.CustomSchemaIds(i => i.FullName); options.DocInclusionPredicate((docName, description) => true); });
-
0
Hi @ydyazilim, please open a new issue for your problem.
also, share your ANZ version and framework in the new issue.