๐ญ. ๐ฆ๐๐ฎ๐ด๐ด๐ฒ๐ฟ ๐จ๐ โ ๐๐ผ๐ฐ๐ฎ๐น ๐๐ฑ-๐๐ผ๐ฐ ๐๐ฃ๐ ๐ง๐ฒ๐๐๐ถ๐ป๐ด
Swagger UI provides an interactive web interface to visualize and test your OpenAPI documents locally. It is widely used to explore and verify API endpoints during development.
๐ฃ๐๐ฟ๐ฝ๐ผ๐๐ฒ: Quickly test your API endpoints with an intuitive UI directly in your ASP.NET Core app.
๐๐ผ๐ฑ๐ฒ ๐๐ป๐ถ๐ฝ๐ฝ๐ฒ๐:
builder.Services.AddOpenApi();
app.MapOpenApi();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/openapi/v1.json", "v1");
});
Access it at: https://localhost:<port>/swagger
Enable "launchBrowser": true
and set "launchUrl": "swagger"
in launchSettings.json
to auto-open the app at the Swagger UI URL using the HTTPS profile.
๐ฎ. ๐ฆ๐ฐ๐ฎ๐น๐ฎ๐ฟ โ ๐๐ป๐๐ฒ๐ฟ๐ฎ๐ฐ๐๐ถ๐๐ฒ ๐๐ฃ๐ ๐๐ผ๐ฐ๐๐บ๐ฒ๐ป๐๐ฎ๐๐ถ๐ผ๐ป
Scalar is an open-source UI alternative for OpenAPI documentation, designed to provide an interactive experience similar to Swagger UI.
๐ฃ๐๐ฟ๐ฝ๐ผ๐๐ฒ: Offer a clean and customizable interactive API doc experience integrated with your OpenAPI endpoint.
๐๐ผ๐ฑ๐ฒ ๐๐ป๐ถ๐ฝ๐ฝ๐ฒ๐:
builder.Services.AddOpenApi();
app.MapOpenApi();
app.MapScalarApiReference();
Access it at: https://localhost:<port>/scalar/v1
Set "launchBrowser": true
and "launchUrl": "scalar/v1"
in launchSettings.json
to auto-launch the app at the Scalar UI URL with the HTTPS profile.
๐ฏ. ๐ฆ๐ฝ๐ฒ๐ฐ๐๐ฟ๐ฎ๐น โ ๐๐ถ๐ป๐๐ถ๐ป๐ด ๐ข๐ฝ๐ฒ๐ป๐๐ฃ๐ ๐๐ผ๐ฐ๐๐บ๐ฒ๐ป๐๐
Spectral is a powerful linter that checks your OpenAPI document for errors and best practice violations during build time, helping ensure high-quality API definitions.
๐ฃ๐๐ฟ๐ฝ๐ผ๐๐ฒ: Automatically validate and maintain consistency in your OpenAPI documents.
๐ฆ๐ฒ๐๐๐ฝ ๐๐ป๐ถ๐ฝ๐ฝ๐ฒ๐ (๐ถ๐ป .๐ฐ๐๐ฝ๐ฟ๐ผ๐ท):
true
$(MSBuildProjectDirectory)
Run lint:
spectral lint WebMinOpenApi.json
๐ช๐ต๐ถ๐ฐ๐ต ๐๐ผ๐ผ๐น ๐ฑ๐ผ ๐๐ผ๐ ๐ฟ๐ฒ๐น๐ ๐ผ๐ป ๐บ๐ผ๐๐ ๐ณ๐ผ๐ฟ ๐๐ฃ๐ ๐ฑ๐ผ๐ฐ๐๐บ๐ฒ๐ป๐๐ฎ๐๐ถ๐ผ๐ป ๐ฎ๐ป๐ฑ ๐๐ฒ๐๐๐ถ๐ป๐ด ๐ถ๐ป ๐๐ผ๐๐ฟ ๐ฝ๐ฟ๐ผ๐ท๐ฒ๐ฐ๐๐? ๐๐ฎ๐๐ฒ ๐๐ผ๐ ๐๐ฟ๐ถ๐ฒ๐ฑ ๐ฐ๐ผ๐บ๐ฏ๐ถ๐ป๐ถ๐ป๐ด ๐๐ต๐ฒ๐๐ฒ ๐๐ผ๐ผ๐น๐ ๐ณ๐ผ๐ฟ ๐ฎ ๐บ๐ผ๐ฟ๐ฒ ๐ฟ๐ผ๐ฏ๐๐๐ ๐ข๐ฝ๐ฒ๐ป๐๐ฃ๐ ๐๐ผ๐ฟ๐ธ๐ณ๐น๐ผ๐?
Top comments (0)