mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Make custom swagger attributes also work with parameter info
If somebody ever uses it as such, that is
This commit is contained in:
@@ -37,11 +37,17 @@ namespace ArchiSteamFarm.IPC.Integration {
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
if (context.MemberInfo == null) {
|
||||
ICustomAttributeProvider customSwaggerAttributes;
|
||||
|
||||
if (context.MemberInfo != null) {
|
||||
customSwaggerAttributes = context.MemberInfo;
|
||||
} else if (context.ParameterInfo != null) {
|
||||
customSwaggerAttributes = context.ParameterInfo;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (CustomSwaggerAttribute customSwaggerAttribute in context.MemberInfo.GetCustomAttributes<CustomSwaggerAttribute>()) {
|
||||
foreach (CustomSwaggerAttribute customSwaggerAttribute in customSwaggerAttributes.GetCustomAttributes(typeof(CustomSwaggerAttribute), true)) {
|
||||
customSwaggerAttribute.Apply(schema);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user