You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When an OData Unbound Function returns an Enum value, the OpenApi definition for that function references the enum type as the schema. However, in practice the enum value is returned wrapped in a JSON object (with a value property). This means that clients generated based on the OpenApi definition expect to see a JSON string but see a JSON object and fail to parse.
Note that this may be generalized to other value types and other types of functions.
Expected behavior
Calling $openapi endpoint should generate the OpenApi document according to what will be returned from the API. In this case something like:
Additional context
This is handled correctly for collections where { value: [...] } is returned from the API. But for scalars the scalar type is reported rather than object which wraps the scalar value.
The text was updated successfully, but these errors were encountered:
Assemblies affected
ASP.NET Core OData 8.x
Describe the bug
When an OData Unbound Function returns an Enum value, the OpenApi definition for that function references the enum type as the schema. However, in practice the enum value is returned wrapped in a JSON object (with a
value
property). This means that clients generated based on the OpenApi definition expect to see a JSON string but see a JSON object and fail to parse.Note that this may be generalized to other value types and other types of functions.
Data Model
Expected behavior
Calling
$openapi
endpoint should generate the OpenApi document according to what will be returned from the API. In this case something like:Actual behavior
The OpenApi definition doesn't mention that an object is returned but rather that an enum value is returned straight away.
Additional context
This is handled correctly for collections where
{ value: [...] }
is returned from the API. But for scalars the scalar type is reported rather than object which wraps the scalar value.The text was updated successfully, but these errors were encountered: