feat: generate additive OpenAPI 3.0.3 document - #259
Conversation
Convert the finalized Swagger 2 artifact to a deterministic OpenAPI 3.0.3 document with strict parity validation and additive CI coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
|
@SocketSecurity ignore npm/es6-promise@3.3.1 Reviewed as an acceptable risk for this PR. This transitive dependency is used only by |
|
@SocketSecurity ignore npm/yargs@17.7.3 Reviewed as an acceptable risk for this PR. |
Summary
docs/openapiv3/apidocs.openapi.jsondeterministically from the finalized Swagger 2 artifact.swagger2openapi@7.0.8and guard conversion with strict shape, parity, reference, example, service, and response validation.Current generation flow
The finalized OAS2 artifact remains the compatibility source for existing consumers. OAS3 is an additive, generated representation of that same API surface.
Why not generate OAS3 directly from proto?
The current protobuf sources express API documentation primarily through
grpc.gateway.protoc_gen_openapiv2.options.*annotations. A native OAS3 generator does not interpret all of that OAS2-specific metadata.A direct generation candidate was evaluated, but its output materially differed from the current API contract:
UpdateStoreoperationPost-processing cannot safely restore metadata that the native generator never emitted. Moving to native proto-to-OAS3 generation therefore requires a separate migration of the protobuf documentation annotations, visibility behavior, response metadata, examples, service merging, and request-body semantics, followed by the same parity validation introduced here.
This PR uses conversion as a compatibility-preserving bridge and does not prevent a future native OAS3 migration.
Compatibility
docs/openapiv2/apidocs.swagger.jsonremains byte-identical and continues to be the SDK generator input.Maintenance model
make all; contributors do not maintain two specifications manually.Validation
npm audit --audit-level=lowmake allbuf lintbuf format -d --exit-codecd proto && go test ./...Scope
This PR adds a documentation-oriented OAS3 artifact only. Server/environment metadata, authentication policy, downstream documentation navigation, specification consolidation, and SDK migration are intentionally out of scope.
Follow-ups