We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right now I need to use some IOperationFilter to do this like:
public class ParameterDefaultValueFilter : IOperationFilter { public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) { var parameterDescriptors = apiDescription.ActionDescriptor.GetParameters(); for (int i = 0; i < parameterDescriptors.Count; i++) { var pd = parameterDescriptors[i]; if (pd.IsOptional && !(pd.ParameterBinderAttribute is FromBodyAttribute)) { operation.parameters[i].@default = pd.DefaultValue; } } } }
According to Swagger 2.0, default value on a parameter is supported as long as it's not from body. Could we add this support to Swashbuckle directly?
The text was updated successfully, but these errors were encountered:
Should be resolved in latest release - 5.2.0
Sorry, something went wrong.
Is there some way you need to activate this? I have tried upgrading to 5.2.0, but my default params doesn't show without using the above code?
No branches or pull requests
Right now I need to use some IOperationFilter to do this like:
According to Swagger 2.0, default value on a parameter is supported as long as it's not from body. Could we add this support to Swashbuckle directly?
The text was updated successfully, but these errors were encountered: