Skip to content

Flip JsonStringEnumConverter allowIntegerValues to false across services #660

@aurelianware

Description

@aurelianware

Context

The shared AddCloudHealthOfficeJsonOptions() helper introduced in
claude/shared-json-options-3YZO1 / commit 6043ce7 registers
JsonStringEnumConverter with the framework default allowIntegerValues: true.

This is intentional for the first rollout — it preserves backward compatibility
with any external caller still POSTing numeric enum values (e.g. "status": 4
instead of "status": "Approved"). Without it, a cutover from integer-enum
to string-enum payloads would have been a breaking change for any client
that hadn't migrated.

The problem with leaving it

Once the shared extension is adopted everywhere, integer-enum payloads
silently continue to work. The whole point of centralizing the converter
is to make the string-enum contract enforceable. If allowIntegerValues
stays true forever, external callers will keep POSTing ints, and we'll
discover a year from now that the "migration" never actually finished.

Definition of done

  • Identify any external callers still sending numeric enum values
    (grep HTTP access logs / OpenAPI consumer telemetry if available,
    or ask API consumers directly).
  • Give those callers a deprecation window to migrate.
  • Change new JsonStringEnumConverter() to
    new JsonStringEnumConverter(namingPolicy: null, allowIntegerValues: false)
    in src/services/shared/CloudHealthOffice.Infrastructure/Json/CloudHealthOfficeJsonOptions.cs.
  • Verify no CI tests regress.
  • Update docs/architecture/shared-json-options.md to reflect the change.

References

  • Shared extension: src/services/shared/CloudHealthOffice.Infrastructure/Json/CloudHealthOfficeJsonOptions.cs
  • Follow-up called out in docs/architecture/shared-json-options.md
  • Related commit: 6043ce7 (PR for claude/shared-json-options-3YZO1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions