Skip to content
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

ViewModel uses "+" splicing, and the swagger request body parameter is missing #2703

Closed
netnr opened this issue Sep 4, 2023 · 1 comment
Closed

Comments

@netnr
Copy link

netnr commented Sep 4, 2023

<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />

image

Resolver error at paths./api/MS/MsSenderPost.post.requestBody.content.application/json.schema.$ref
Could not resolve reference: Could not resolve pointer: /components/schemas/Netnr.Admin.Domain.Models.ViewModel+MSModel does not exist in document

image


If I change to "." splicing, the request body parameters are displayed normally

image

@netnr
Copy link
Author

netnr commented Sep 6, 2023

builder.Services.AddSwaggerGen(c =>
{
    c.CustomSchemaIds(type => type.FullName.Replace("+", "."));
});

Got it

@netnr netnr closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant