Skip to content

generate openapi json error when custom IBindingSourceMetadata #59013

New issue

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

Closed
1 task done
cjdxhjj opened this issue Nov 18, 2024 · 10 comments · Fixed by #59035
Closed
1 task done

generate openapi json error when custom IBindingSourceMetadata #59013

cjdxhjj opened this issue Nov 18, 2024 · 10 comments · Fixed by #59035
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi
Milestone

Comments

@cjdxhjj
Copy link

cjdxhjj commented Nov 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Image
Image
Image
Image

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

9.0.100

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Nov 18, 2024
@cjdxhjj
Copy link
Author

cjdxhjj commented Nov 18, 2024

another question: the description not work on fromform field
Image
Image

@martincostello
Copy link
Member

Please provide a minimal reproducible example as a GitHub repository that demonstrates the issue you're experiencing so the team can look into this further.

Code provided as a screenshot needs to be transcribed from them - providing code as code is much more useful.

Similarly, please also provide error messages as text not screenshots. Then it's easy for people to copy-paste things like method names from stack traces.

@martincostello martincostello added feature-openapi area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates and removed old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Nov 18, 2024
@captainsafia
Copy link
Member

@cjdxhjj Thanks for reporting this issue! 👍🏽 to @martincostello's point that when possible error messages and repros are better shared in text or repos over screenshots since it makes it easier to investigate the issue.

With that in mind, I've opened #59035 with a proposed resolution for this bug.

@captainsafia captainsafia self-assigned this Nov 18, 2024
@captainsafia captainsafia added this to the 10.0-preview1 milestone Nov 18, 2024
@cjdxhjj
Copy link
Author

cjdxhjj commented Nov 19, 2024

thanks very much @captainsafia @martincostello

@cjdxhjj
Copy link
Author

cjdxhjj commented Nov 19, 2024

[HttpPost, EndpointSummary("test dataform")]
public ActionResult DataForm([FromForm, Description("name of person")] string name, [FromForm, Description("age of person")] int age)
{
return Content(name);
}

@cjdxhjj
Copy link
Author

cjdxhjj commented Nov 19, 2024

Image
the description is missing

@captainsafia
Copy link
Member

another question: the description not work on fromform field Image Image

Do you mind filing this bug report into a separate issue?

@cjdxhjj
Copy link
Author

cjdxhjj commented Nov 19, 2024

ok, i will upload a repo
Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetParametersAsync(ApiDescription description, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetOperationAsync(ApiDescription description, HashSet capturedTags, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetOperationsAsync(IGrouping<string, ApiDescription> descriptions, HashSet capturedTags, IServiceProvider scopedServiceProvider, IOpenApiOperationTransformer[] operationTransformers, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetOpenApiPathsAsync(HashSet capturedTags, IServiceProvider scopedServiceProvider, IOpenApiOperationTransformer[] operationTransformers, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetOpenApiDocumentAsync(IServiceProvider scopedServiceProvider, CancellationToken cancellationToken)
Microsoft.AspNetCore.Builder.OpenApiEndpointRouteBuilderExtensions+<>c__DisplayClass0_0+<b__0>d.MoveNext()
Microsoft.AspNetCore.Http.Generated.<GeneratedRouteBuilderExtensions_g>F56B68D2B55B5B7B373BA2E4796D897848BC0F04A969B1AF6260183E8B9E0BAF2__GeneratedRouteBuilderExtensionsCore+<>c__DisplayClass2_0+<g__RequestHandler|5>d.MoveNext()
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

@cjdxhjj
Copy link
Author

cjdxhjj commented Nov 19, 2024

@cjdxhjj
Copy link
Author

cjdxhjj commented Nov 19, 2024

@captainsafia the desciption missing issure #59042

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants