Open elliot-huffman opened 10 months ago
@qiaozha Looks like another inaccurate service description
@xirzec I think you are right and as they are retiring S360 which is used to make sure service backend behaves the same as their rest api specs, I am afraid we will get more and more issues like this. 😭
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.
potential work for x-ms-null in codegen. @kazrael2119 Could you create an issue in autorest typescript repo ?
Describe the bug The documentation and typings are incorrect for these objects: Host Pool: https://learn.microsoft.com/en-us/rest/api/desktopvirtualization/host-pools/get?tabs=HTTP#hostpool
Session Host: https://learn.microsoft.com/en-us/rest/api/desktopvirtualization/session-hosts/get?tabs=HTTP#sessionhost
The properties are nullable but are not documented as such. Instead, the API docs and typings says they are
optional properties
, which is different fromnull
. in JavaScript/TypeScriptundefined !== null
As a workaround, I must override the schema of the resultant object so that TypeScript doesn't freak out when I compare against null instead of Undefined.To Reproduce Steps to reproduce the behavior:
null
which is undocumented and not in the typings.Expected behavior The Documentation and typings reflect the actual state of the API.
Screenshots Screenshot of the
Host Pool
's registration info property returning null when no valid registration key is set. Othernull
values are noted for your reference as this is a rampant issue that affects more than just my stuff:Screenshot of a session host object with null values present:
Additional context This should not be a server-side fix, just a client and docs fix. May require updating the OpenAPI spec that generates the clients. Also, the skip token is not documented properly, even though it exists, just a separate thing to note.
Below is some workaround code to hot patch this behavior, this should not be needed if the typings were correct.
Host Pool Workaround:
Session Host Workaround: