Help wanted with update to 4.7.2 System.Text.Json
See original GitHub issueHello, Help wanted.
I’m developing Swagger documentation package for Azure Functions, which is dependent on
Microsoft.Azure.WebJobs.Extensions.Http
Microsoft.Azure.Functions.Extensions
packages
Currently, it’s not possible for me to update the version System.Text.Json. from 4.7.0 => 4.7.2 (or 4.7.1, 5.0.0) as I’m getting the following error:
'Method not found: 'Void Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter..ctor(System.Text.Json.JsonSerializerOptions)'.'
The issue is described here: https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/issues/30
Repro steps
Provide the steps required to reproduce the problem
-
Download the repo (https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/tree/dev)
-
Update from 4.7.0 to 4.7.2 both TestFunction and AzureFunctions.Extensions.Swashbuckle
- When only AzureFunctions.Extensions.Swashbuckle is updated to 4.7.2, while TestFunction is using 4.7.0 it works.
-
Start the project.
Expected behavior
Works
Actual behavior
'Method not found: 'Void Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter..ctor(System.Text.Json.JsonSerializerOptions)'.'
Related information
I was trying to investigate it is much as possible in here => https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/tree/branch/trying-update-json
I have substituted SystemTextJsonOutputFormatter with my version => SystemTextJsonOutputFormatter2, which uses it’s own TranscodingWriteStream, as they are both sealed and internal, it was not possible to override anything.
Now it fails during function call => http://localhost:7071/api/Swagger/ui though with the same error:
I think, that is related to the fact that one of these projects has not been updated fully.
- System.Text.Json 4.7.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:15 (2 by maintainers)
Apologies for the delayed response here.
This is a reasonable request. I’ll move it to the host repo, where we’d have to address this (that’s the component performing the unification) and track it for the next sprint.
Our team did the same as @johnnyreilly originally did but we are targeting https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi/1.0.0.
It wasn’t an easy transition from using @vitalybibikov 's packages, and we still have a lot of attribute migrations left but so far so good. Any issues we ran into were acceptable since at least we have docs up and running again.
FWIW, we also took advantage of this overhaul to rethink our strategy and ended up moving all documentation for all APIs into a single Swagger-Doc specific project/repo. The documentation process and rendering can now have whatever dependencies it wants without having to argue with production operational needs. Having a production website failing to run because of a documentation library is unacceptable for us.
Overall, this has been a win for our team in many ways and I wish I had thought of it sooner. Again, any issues we’ve run into have been few and are acceptable.
HTH