Skip to content

Drop the two unused query component schemas from the OpenAPI specification #484

Description

@leynos

Summary

spec/openapi.json publishes two component schemas that nothing references:
ListEnrichmentProvenanceQuery and ListOfflineBundlesQuery. Both describe
query parameters rather than request or response bodies, so no operation points
at them and no client generator has a use for them.

Redocly's no-unused-components rule reports both. They are warnings, not
errors, so make lint-openapi passes with them present:

[1] spec/openapi.json:259:7 at #/components/schemas/ListEnrichmentProvenanceQuery
Component: "ListEnrichmentProvenanceQuery" is never used.

[2] spec/openapi.json:301:7 at #/components/schemas/ListOfflineBundlesQuery
Component: "ListOfflineBundlesQuery" is never used.

spec/openapi.json: validated in 93ms
Woohoo! Your API description is valid. 🎉
You have 2 warnings.

Proposed change

Drop the ToSchema derive from both structs and remove them from ApiDoc's
component list:

  • backend/src/inbound/http/admin_enrichment.rs, ListEnrichmentProvenanceQuery
  • backend/src/inbound/http/offline.rs, ListOfflineBundlesQuery
  • backend/src/doc.rs, the two entries in the registered components
  • spec/openapi.json, regenerated by make openapi

Both types stay Deserialize and Serialize, and both remain in use through
web::Query<...> in their handlers. Only the OpenAPI registration goes.

Why this is not part of the TypeDoc gate

The change arrived on the typedoc-rollout branch (#436) inside the commit
"Repair gate-discovered validation failures", which grouped several unrelated
repairs found during a full gate run. Everything else in that commit has since
landed on main independently. This part had not, and it is a change to the
published API specification rather than a repair of a failing gate: the gate it
was attributed to passes either way. #436 restores these files to match main
and leaves the cleanup to this issue, so the specification change gets reviewed
on its own terms.

Acceptance

  • make lint-openapi reports zero warnings.
  • make openapi regenerates spec/openapi.json with no diff afterwards.
  • No behavioural change to either handler.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationlowBacklog work, hygiene, or technical debt planned opportunistically, without a strict deadline.refactorBehaviour-preserving restructuring that improves code health.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions