OpenAPI.NET.OData
OpenAPI.NET.OData copied to clipboard
$expand is reported as enum while it is actually string
Current behavior: $expand is enum.
Expected behavior:
$expand is string because you can have complex expressions in $expand like for example $expand=Groups($expand=Members)
If we updated the schema to be like this it would allow us to provide a list of properties that are expandable but also indicate that each expand property could be a more complex syntax.
schema:
uniqueItems: true
type: array
items:
anyOf:
- enum:
- '*'
- serviceAnnouncement
- type: string
Thoughts?
adding some more context here due to https://github.com/microsoft/kiota/pull/4265 https://github.com/microsoftgraph/msgraph-sdk-typescript/pull/512
currently expand, orderby, select are projected as arrays of enums. In all three cases this is wrong because of nested expands/selects and nested properties ordering
e.g.
$expand=Groups($expand=Members)
$select=manager($select=firstName)
$orderBy=manager.firstName
projecting all possibilities for all sub-properties combinations would lead to huge and hard to read enums projecting only the first level properties like today is constraining. projecting only the first level sub-properties with a oneOf with a string (variation of what Darrel proposed) I believe will lead to confusion (is this only what's supported?), won't be useful for validation or code generation purposes.
I propose we simply project those three as arrays of strings instead. Which will have the additional benefit of making Microsoft Graph descriptions quite smaller too.
We do have a hard dependency on that though, GE relies on this to auto completion. We need to tie this new behaviour to a conversion setting switch (true by default, false for GE) "EmitExpandSelectAndOrderByAsStrings" (or a better name)
I propose we simply project those three as arrays of strings instead. Which will have the additional benefit of making Microsoft Graph descriptions quite smaller too.
+1