Skip to content

openapi: split operations.go by construct #1057

Closed

Description

@OmarAlJarrah

Problem

compilers/openapi/internal/operation/operations.go (1,378 lines) holds five constructs beside the operation itself:

  • the path-item walk and how a path item mounts;
  • tag grouping;
  • responses and status keys;
  • callbacks;
  • webhooks.

paramledger.go is a helper only params.go uses. pathitemref_beside_test.go tests pathitemref.go alongside pathitemref_test.go.

Direction

  • pathitem.go: paths, path items, mounting, and the path-item fields an operation inherits.
  • groups.go: tags and service grouping (it pairs with the existing groups_test.go).
  • responses.go: responses, status-key parsing, error cases.
  • callbacks.go: callbacks and webhooks.
  • params.go gains parameter merging and the parameter ledger; paramledger.go goes.
  • operations.go keeps LowerService and the lowering of one operation.
  • Tests follow their names; pathitemref_beside_test.go merges into pathitemref_test.go. The three TestContent_* tests in operations_test.go stay until openapi: split content.go by construct #1059 splits content.go, because content_test.go is busy until then.

Blocked by

#1046 edits operations_test.go, params.go, params_test.go and groups_test.go.

Done when

  • Every top-level declaration of the package, with its doc comment and any comment between declarations, is byte-identical before and after the move (compared with a throwaway go/ast script), and no golden changes.
  • Comments that name a file name the file the code now lives in, changed in a commit of their own.
  • go test ./compilers/openapi/... passes without -update.

Priority: P4, rule 1 (housekeeping: moves code between files and changes no lowering, validation, IR or emit-contract behaviour). wc -l compilers/openapi/internal/operation/operations.go → 1378 (morphic @a1f15b29).

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P4Refactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formatstype:choreRefactor or cleanup, no behavior change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions