@@ -11,16 +11,6 @@ public static void AddOperationTransformer(this OpenApiOptions options)
1111 {
1212 options . AddOperationTransformer ( ( operation , context , cancellationToken ) =>
1313 {
14- /*if (context.Description.ActionDescriptor.EndpointMetadata.OfType<IAuthorizeData>().Any())
15- {
16- operation.Security = new List<OpenApiSecurityRequirement>
17- {
18- new OpenApiSecurityRequirement
19- {
20- [new OpenApiSecurityScheme { Scheme = "Bearer" }] = new List<string>()
21- }
22- };
23- }*/
2414 var enableQuery = context . Description . ActionDescriptor ? . FilterDescriptors . Where ( x => x . Filter . GetType ( ) == typeof ( EnableQueryAttribute ) ) . FirstOrDefault ( ) ;
2515 if ( enableQuery != null )
2616 {
@@ -105,19 +95,25 @@ public static void AddCsrfTokenTransformer(this OpenApiOptions options)
10595 return Task . CompletedTask ;
10696 } ) ;
10797 }
108- public static void AddContactDocumentTransformer ( this OpenApiOptions options , string name )
98+ public static void AddContactDocumentTransformer ( this OpenApiOptions options , string name , string version )
10999 {
110100 options . AddDocumentTransformer ( ( document , context , cancellationToken ) =>
111101 {
112- document . Info . Contact = new OpenApiContact {
113- Name = name ,
114- 115- Url = new Uri ( "https://grandnode.com" )
116- } ;
117- document . Info . License = new OpenApiLicense {
118- Name = "GNU General Public License v3.0" ,
119- Url = new Uri ( "https://github.com/grandnode/grandnode2/blob/main/LICENSE" )
102+ document . Info = new OpenApiInfo {
103+ Description = "Grandnode API" ,
104+ Title = name ,
105+ Version = version ,
106+ Contact = new OpenApiContact {
107+ Name = name ,
108+ 109+ Url = new Uri ( "https://grandnode.com" )
110+ } ,
111+ License = new OpenApiLicense {
112+ Name = "GNU General Public License v3.0" ,
113+ Url = new Uri ( "https://github.com/grandnode/grandnode2/blob/main/LICENSE" )
114+ }
120115 } ;
116+
121117 return Task . CompletedTask ;
122118 } ) ;
123119 }
0 commit comments