Skip to content

openapi: move server lowering out of meta.go into servers.go #1055

Closed

Description

@OmarAlJarrah

Problem

compilers/openapi/meta.go lowers the document's servers beside its info, tags, retained components, dialect and unknown keys, so the server lowering is found only by searching.

Direction

  • servers.go: lowerServers, lowerServer, serverName, serverVariables and unnamedServerHint. Their tests move from meta_test.go to servers_test.go.
  • The code stays in compilers/openapi. Path-item and operation servers will need lowerServer once the IR gives them a field (ir: decide whether four no_ir_home operation constructs get real fields #285), and internal/operation cannot import the package above it. That change moves servers.go beneath operation, not this one.

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). grep -c '^func .*[Ss]erver' compilers/openapi/meta.go → 4 (morphic @a1f15b29).

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

    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