Fix OpenAPI enum serialization inconsistency (SourceControlType vs TerraformSourceType)
Nobody has claimed this yet.
- 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
- Decide on a consistent enum serialization strategy (string or integer) for all enums
- Configure Swashbuckle to emit enums consistently
- Add a test that validates the generated spec matches runtime serialization
Identified in multi-model review of PR #584 (Finding #14)
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.
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