Azure-functions-host: Help wanted with update to 4.7.2 System.Text.Json

Created on 7 Dec 2020  路  6Comments  路  Source: Azure/azure-functions-host

Hello,
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

  1. Download the repo (https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/tree/dev)

  2. 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.
  3. Start the project.

Expected behavior

Works

Actual behavior

'Method not found: 'Void Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter..ctor(System.Text.Json.JsonSerializerOptions)'.'

image

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:

image

I think, that is related to the fact that one of these projects has not been updated fully.

  • System.Text.Json 4.7.2

Most helpful comment

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.

All 6 comments

Hi,

Any updates on this one?

@v-anvari @fabiocav

Hi,

Any updates on this one?

@v-anvari @fabiocav

Hi,

Any updates on this one?

@v-anvari @fabiocav

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.

I just ran into this. Ugh. I brought in HtmlTags package which depends on System.Text.Json >= 5.0.0. I guess no Swagger docs for this function app for now. :(

Are there any workarounds (ugly or not) that you've found in the meantime? @fabiocav @vitalybibikov

The current release is locked with multiple sprints. Pushing this to the next sprint as it will be part of a separate release.

Was this page helpful?
0 / 5 - 0 ratings