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

Contracts should be serializable/deserializable using System.Text.Json #352

Closed
chandramouleswaran opened this issue Jul 28, 2020 · 6 comments · Fixed by #1000
Closed

Contracts should be serializable/deserializable using System.Text.Json #352

chandramouleswaran opened this issue Jul 28, 2020 · 6 comments · Fixed by #1000
Assignees
Labels
Breaking-Change Type: Bug Something isn't working

Comments

@chandramouleswaran
Copy link

chandramouleswaran commented Jul 28, 2020

Describe the bug

Contracts should be serializable/deserializable using System.Text.Json
public ProxyMatch Match { get; private set; } = new ProxyMatch();

Private setters are not supported by System.Text.Json

To Reproduce

Try to read the ReverseProxy configuration with System.Text.Json - Match object is created but has null values for all properties.

Further technical details

  • Include the version of the packages you are using - 1.0.0-preview.4.20373.1
  • The platform (Linux/macOS/Windows) - Windows
@chandramouleswaran chandramouleswaran added the Type: Bug Something isn't working label Jul 28, 2020
@samsp-msft
Copy link
Contributor

Why are you trying to serialize the configuration? If what you are trying to do is to dynamically manage the routes, then that will be handled by a new API that is being built as part of #8.

@Tratcher
Copy link
Member

Though serialization may come in handy even in the #8 scenario. You've got to store the data in some format.

@chandramouleswaran
Copy link
Author

Having the feature you have pointed to is useful - in the meantime, we are serializing the dynamically discovered route and updating a JSON which is part of the config management system.

@samsp-msft samsp-msft added this to the 1.0.0 milestone Jul 30, 2020
@samsp-msft
Copy link
Contributor

We should revisit after we have completed #8. Object Model is likely to change as part of design of #8, so we should reassess after design and see whether they are suitable for serialization.

@Tratcher Tratcher self-assigned this Feb 26, 2021
@Tratcher
Copy link
Member

@jkotalik and @davidni, you are both successfully serializing and deserializing the models using System.Text.Json as part of your providers, correct?

The only values I'm aware of that wouldn't be serializable are:
X509Certificate2 ProxyHttpClientOptions.ClientCertificate
Encoding ProxyHttpClientOptions.RequestHeaderEncoding

We should add a regression test for this scenario, and decide what to do about the two properties above.

@Tratcher
Copy link
Member

Tratcher commented May 13, 2021

Other unsupported types I found in testing:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking-Change Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants