sefe / sefe/dorc

Fix OpenAPI enum serialization inconsistency (SourceControlType vs TerraformSourceType)

Open
#591 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
5
Forks
3
Avg merge
1d 22h
Merged PRs (30d)
14

Description

Background

In swagger.json, SourceControlType uses integer values ([0, 1]) while TerraformSourceType uses string values. The application uses JsonStringEnumConverter globally.

Impact

When the OpenAPI spec is regenerated by Swashbuckle, this inconsistency will break the API contract. Clients generated from the spec may send/receive the wrong enum format.

Recommended Approach

  1. Decide on a consistent enum serialization strategy (string or integer) for all enums
  2. Configure Swashbuckle to emit enums consistently
  3. Add a test that validates the generated spec matches runtime serialization

Identified in multi-model review of PR #584 (Finding #14)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the SourceControlType and TerraformSourceType definitions in swagger.json with the application's global JsonStringEnumConverter and Swashbuckle configuration. Determine the intended consistent enum format, then identify where the generated specification and runtime serialization can be tested. Done means both enum definitions and the validation test agree on the chosen format.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.