Skip to content

Commit 9388604

Browse files
committed
refact: Adiciona props e utiliza const no swagger
1 parent 17539a9 commit 9388604

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Program.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,31 @@
3434
{
3535

3636
o.EnableAnnotations();
37-
o.SwaggerDoc(nuVersion, new OpenApiInfo { Title = nmApplication, Version = nuVersion });
37+
o.SwaggerDoc(nuVersion, new OpenApiInfo
38+
{
39+
Title = Constant.SwaggerTitle,
40+
Description = Constant.SwaggerDescription,
41+
Version = nuVersion,
42+
Contact = new OpenApiContact
43+
{
44+
Name = Constant.SwaggerContactName,
45+
Url = new Uri(Constant.SwaggerContactUrl)
46+
},
47+
License = new OpenApiLicense
48+
{
49+
Name = Constant.SwaggerLicenseName,
50+
Url = new Uri(Constant.SwaggerLicenseUrl)
51+
}
52+
53+
});
54+
3855
o.AddSecurityDefinition(Constant.API_KEY, new OpenApiSecurityScheme
3956
{
4057
In = ParameterLocation.Header,
41-
Description = "Chave de acesso individual disponibilizado para acessar a API",
58+
Description = Constant.SwaggerSecurityDescription,
4259
Name = Constant.API_KEY,
4360
Type = SecuritySchemeType.ApiKey,
44-
Scheme = "ApiKeyScheme"
61+
Scheme = Constant.SwaggerSecurityScheme
4562
});
4663

4764
o.OperationFilter<SwaggerAllowAnonymousOperationFilter>();

0 commit comments

Comments
 (0)