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

Rust devtunnels client can no longer parse TunnelEndpoints #318

Closed
connor4312 opened this issue Sep 25, 2023 · 2 comments
Closed

Rust devtunnels client can no longer parse TunnelEndpoints #318

connor4312 opened this issue Sep 25, 2023 · 2 comments

Comments

@connor4312
Copy link
Member

connor4312 commented Sep 25, 2023

@jfullerton44 in this change, the ID for the tunnel endpoint became mandatory

https://github.com/microsoft/dev-tunnels/blame/c85e0671d98dd25331149959af6e4adf67dfb2b8/cs/src/Contracts/TunnelEndpoint.cs#L31

However, it seems like the Dev Tunnels service does not actually return that as a non-nullable string. For example, this is my tunnel in production

  "endpoints": [
    {
      "hostRelayUri": "wss://usw2-data.rel.tunnels.api.visualstudio.com/api/v1/Host/Connect/29034sjz",
      "clientRelayUri": "wss://usw2-data.rel.tunnels.api.visualstudio.com/api/v1/Client/Connect/29034sjz",
      "id": null,
      "connectionMode": "TunnelRelay",
      "hostId": "706f244f-a4d3-422c-a8a4-f8dc272cb7e5",
      "portUriFormat": "https://29034sjz-{port}.usw2.devtunnels.ms/",
      "tunnelUri": "https://29034sjz.usw2.devtunnels.ms/",
      "portSshCommandFormat": "ssh 29034sjz-{port}@ssh.usw2.devtunnels.ms",
      "tunnelSshCommand": "ssh 29034sjz@ssh.usw2.devtunnels.ms"
    }
  ],

So, trying to parse that in Rust gives invalid type: null.

The generator uses the presence of the [JsonIgnore(...)] attribute to determine if a field should be nullable. Should that be applied to the ID?

@jfullerton44
Copy link
Collaborator

In future api-versions the id should always be set, but for now I get your point. I created a PR to make this property nullable which should make the changes more backwards compatible #319

@connor4312
Copy link
Member Author

Thanks!

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

2 participants