Skip to content

Fix for issue 2970 Pass enum value list when ReturnEnumsAsPrimitive parses schema enum #2970 - #3089

Open
David Oku (MasterOfLogic1) wants to merge 2 commits into
microsoft:mainfrom
MasterOfLogic1:fix/2970-integer-enum-list-mapping
Open

David Oku (MasterOfLogic1) wants to merge 2 commits into
microsoft:mainfrom
MasterOfLogic1:fix/2970-integer-enum-list-mapping

Conversation

@MasterOfLogic1

Copy link
Copy Markdown

Title

Pass schema enum values when ReturnEnumsAsPrimitive is enabled

Description

Fixes #2970

Summary

When OpenAPI parameters use inline enum on the schema (string or integer), TryGetOptionSet can return a primitive type when ConnectorSettings.ReturnEnumsAsPrimitive is true. Those code paths were passing the wrong list argument into ConnectorType: they reused the variable from the x-ms-enum-values path, which is often null when only schema.enum is present.

This change passes the dictionary built from schema.Enum (dic) so enum value metadata is available for connector parsing (including integer enums covered by enum-integer.json and OpenApiParserTests.EnumTypeInteger).

Note: Integer enum support for unsupported operations was added in #2977; this PR corrects primitive-mode value list wiring for inline schema enums.

Changes

  • OpenApiExtensions.cs — ReturnEnumsAsPrimitive branches for OpenApiString and OpenApiInteger schema enums now use list: dic with the appropriate FormulaType / isNumber flags.

Test plan

  • OpenApiParserTests.EnumTypeInteger
  • All OpenApiParser* tests (net462)
  • Full Microsoft.PowerFx.Connectors.Tests (net462): 564 passed, 16 skipped

@MasterOfLogic1
David Oku (MasterOfLogic1) requested a review from a team as a code owner September 22, 2026 17:56
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@MasterOfLogic1 David Oku (MasterOfLogic1) changed the title Fix for issue 2970 Pass enum value list when ReturnEnumsAsPrimitive parses schema enum Fix for issue 2970 Pass enum value list when ReturnEnumsAsPrimitive parses schema enum #2970 Sep 22, 2026
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

Successfully merging this pull request may close these issues.

Enum of type integer is not supported by OpenApiParser

1 participant