mirror of
https://github.com/zap-proto/zip.git
synced 2026-10-19 15:38:57 +00:00
The extractor paired the type-checked view of a struct (authoritative for names and tags) with the parsed view (which carries the comments) by matching a byte OFFSET. That works only for a package this pass loaded from source. A position in an IMPORTED package comes from export data, whose positions carry the real filename and line and a synthetic offset — the importer fabricates a file whose every line is one byte long. So the offsets never matched the moment a type lived in another package. Which is every op whose In and Out live in the call plane. Those ops published a description and ZERO field descriptions: the OpenAPI schema, the CLI flag help and every generated SDK's field docstrings were all nameless, and nothing failed because a missing description is not an error. Match on the LINE, which both views agree on, and disambiguate by type name. Co-authored-by: Hanzo Dev <[email protected]>
31 lines
975 B
Go
31 lines
975 B
Go
// Package plane holds the in-fleet call plane's shapes. An op's In and Out live
|
|
// HERE, one name one shape, and the ops that carry them live in the packages
|
|
// that serve them — which is the whole reason a doc comment has to cross a
|
|
// package boundary to reach the spec.
|
|
package plane
|
|
|
|
// ListIn asks for a page of workers.
|
|
type ListIn struct {
|
|
// Org whose workers to list.
|
|
Org string `json:"org" validate:"required"`
|
|
// Limit caps how many come back.
|
|
Limit int `json:"limit,omitempty"`
|
|
}
|
|
|
|
// ListOut is a page of workers.
|
|
type ListOut struct {
|
|
// Workers, newest first.
|
|
Workers []Worker `json:"workers"`
|
|
// Next is the cursor for the following page.
|
|
Next string `json:"next"`
|
|
}
|
|
|
|
// Worker is one deployed script. Nested a package away, so its prose has the
|
|
// furthest to travel.
|
|
type Worker struct {
|
|
// Name is the worker's stable name, unique in the org.
|
|
Name string `json:"name"`
|
|
// Live reports whether it is serving traffic.
|
|
Live bool `json:"live"`
|
|
}
|