dotnet / dotnet/aspnetcore

We need a solution for API Explorer + Custom ModelBinder

Open
#4,825 10 comments 20 reactions 0 assignees View on GitHub
affected-few area-mvc enhancement feature-openapi Needs: Design severity-major
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

see: https://github.com/aspnet/Mvc/issues/5673#issuecomment-281738074 and https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/309

The complaint here is that we 'expand' a parameter in the API definition that's being bound by a custom model binder. API explorer has no interaction with model binders/providers, and so no way to know that this isn't being handled by the default binder.

In this case we already have a metadata feature that would give the desired API explorer output, `ModelMetadata.IsComplexType == false`. However we don't allow user code to configure this value.

We should either make this configurable, or probe the model binders for information about types that have custom handling.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.