Enum return value schema is wrong
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start in OpenApiResponseGenerator.cs and reproduce the function response using the provided OData CSDL. Compare how collection and primitive return types are wrapped with the enum path, then verify that the generated schema uses an object with a value property referencing RemoteAccessStatus.
Written by the indexing model from the issue text.
Description
If a function returns Enum resulting schema is not wrapped but instead represented as enum itself.
Assemblies affected
Microsoft.OpenApi.OData 1.7.4
Steps to reproduce
I have a function that returns enum. It goes like this:
<Function Name="GetRemoteAccessStatus" IsBound="true">
<ReturnType Type="RemoteAccessStatus" Nullable="false"/>
</Function>
<EnumType Name="RemoteAccessStatus">
<Member Name="None" Value="0"/>
<Member Name="Requested" Value="1"/>
<Member Name="Active" Value="2"/>
</EnumType>
Expected result
In the resulting schema I want to see something like this:
schema:
type: object
properties:
value:
anyOf:
- $ref: '#/components/schemas/RemoteAccessStatus'
Actual result
Actually I get (skipped value):
schema:
$ref: '#/components/schemas/Pbx.RemoteAccessStatus'
Additional information
I thinks the issue is in OpenApiResponseGenerator.cs where for collection and primitive types it wraps the responses but not for Enum
- Dominant language
- C#
- Stars
- 240
- Forks
- 70
- Avg merge
- 7h 59m
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/OpenAPI.NET.OData
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/OpenAPI.NET.OData#661 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
microsoft/OpenAPI.NET.OData#852 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/OpenAPI.NET.OData#833 ·
-
status:needs-more-information
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/OpenAPI.NET.OData#723 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
microsoft/OpenAPI.NET.OData#720 ·
All issues in microsoft/OpenAPI.NET.OData
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·