azure-functions-extensions-swashbuckle icon indicating copy to clipboard operation
azure-functions-extensions-swashbuckle copied to clipboard

dotnet core v3.1 | Request Body is Blank (even in sample Product Controller test)

Open jeffward01 opened this issue 4 years ago • 5 comments

Hello!

Thanks for the great package. Thanks to some of the other issues and solutions provided by other contributors I have been able to install AzureFunctions.Extensions.Swashbuckle.Attribute in my dotnet core v3.1 Azure Function project.


I have a few bugs I am working out with this. The main one I would like to post about because its pretty impactful is that the

RequestBody

is missing from the Swagger documentation. I also tested this using the test code provided and was able to reproduce.

(Note: in dotnet core v3.1 I recieved an error leaving 'post', 'product' in the HttpTrigger Annotation. To get it to build I had to remove the 'product' string. I will circle it in my code.) image

image


Any idea what could be creating the issue?

jeffward01 avatar Feb 22 '20 02:02 jeffward01

Here are the models (from the sample example) image

jeffward01 avatar Feb 22 '20 02:02 jeffward01

Hi @jeffward01, I believe that this is a copy of issue #21. Dotnet core 3.1 suggest that you are using the 3.0 runtime. Could you report the bugs over there to have them centralized?

mligtenberg avatar Feb 22 '20 22:02 mligtenberg

You are correct, I am using:

dotnet core 3.1 Azure Functions V3


@mligtenberg Ah I thought this was a new issue. Originally my code was not working with dotnet core v 3.1. My Swagger UI was not loading and I was receiving the error seen [here](in Issue #21).

A host error has occurred during startup operation 'a9f43d8a-89ae-4480-8c8f-9b6b8ad75098'. [5.12.2019 14:46:13] AzureFunctions.Extensions.Swashbuckle: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.DefaultValidationMetadataProvider' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

I reviewed issue #21 and used the solution provided by (vitalybibikov) here.

After I pulled his code fork, my Swashbuckle with Azure Functions began to work, and I was able to access the Swagger UI (yay.)

So his solution did work, and did 'fix' my Swashbuckle issue as now I can see Swagger UI as you can see from my screenshots.


Although, now I have a new issue with the Response Body not showing up as seen in my screenshots.


Due to the steps I followed above, I thought this was a new issue. I can move it over to the other thread, what do you suggest?

jeffward01 avatar Feb 24 '20 16:02 jeffward01

It is fixed as well, you can use the updated Nuget.

vitalybibikov avatar Feb 27 '20 20:02 vitalybibikov

How are you generating your swagger.json? I know for me the 3.1 .net core version interfered with that and needed some extra work.

kevdev424 avatar Mar 13 '20 22:03 kevdev424