Swagger Editor import vs Swagger UI hosting for restoring an OpenAPI backup with relative $refs
0 reputation · 13 Dec 2023, 22:20 UTC
I keep backups of an OpenAPI 3.0 specification split across multiple files: a root openapi.yaml plus sibling schema files referenced through relative $ref paths. When I restore a backup to a new folder, the directory layout may not match the original, and I need the restored spec to be complete and verifiable.
There seem to be two documented ways to work with the restored files: importing the root file into Swagger Editor, or serving the folder over HTTP and loading it in Swagger UI. My understanding is that Editor resolves references in the browser with more relaxed handling, while UI enforces stricter same-origin rules and resolves relative paths against the served base URL. That suggests the same restored backup could render fully in one tool and show missing operations in the other, without an obvious error message.
Assume current stable releases of both tools, with the bundled Swagger Parser version unverified.
Which approach is more reliable for confirming that a restored multi-file spec is intact? Should I trust the rendered operation list in either tool, or is independent validation (for example swagger-cli validate) required in both cases? And when relative $ref targets move outside the spec's directory after restore, is there a documented way to make resolution deterministic across both tools?