feat(import): rich OpenAPI import — servers as environments, auth, bodies, URL fetch - #249
Merged
Merged
Conversation
…dies, URL fetch
- servers[] become one environment each, carrying {{baseUrl}} plus server
variables; the first created environment is activated after import
- imported fallback vars merge into globals only for unset keys (no more
baseUrl clobbering across imports)
- securitySchemes/security map onto AuthConfig (bearer, basic, apiKey,
oauth2 flows, openIdConnect); per-op security overrides, [] means none
- request bodies: json / *+json, form-urlencoded, multipart (binary-aware),
xml (sampled), text/plain, raw fallback; Swagger 2 formData/body params
- richer metadata: collection + folder + request descriptions, deprecated
flag (struck through in the sidebar), 2xx-first response examples,
stable oa-<operationId> request ids, tag-ordered folders
- OpenAPI 3.1 tolerance: nullable type arrays, const, examples arrays,
friendly error for webhooks-only documents
- import from URL: fetched through the engine (no CORS), wired into the
ImportModal as Paste | URL | File tabs; bare URLs pasted into the
textarea are detected and fetched
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major upgrade of the OpenAPI (3.x + Swagger 2, JSON and YAML) importer.
Servers → environments
servers[]entry becomes a project environment named<API title> — <server description|host>, carrying its own{{baseUrl}}value plus one variable per servervariable({region}URL templating →{{region}}).baseUrlet al.) merge into globals only for unset keys — fixes the pre-existing clobbering bug where every import overwrotebaseUrl.baseUrlis never written tocollection.vars(it would shadow environments in the scope cascade).Richer collections
info.description(+ version, external docs); folder descriptions and ordering from roottags[]; request descriptions fromop.description;deprecatedflag rendered struck-through in the sidebar with a description tooltip.operationId(oa-<slug>) for re-import friendliness.Auth
securitySchemes/security→AuthConfig: http bearer/basic, apiKey (header/query), oauth2 (clientCredentials / authorizationCode / password / Swagger 2 flows), openIdConnect (issuer). Per-operationsecurityoverrides;security: []→ none; default stays inherit. Credentials left empty for the user to fill.Bodies
application/jsonand*+json,x-www-form-urlencoded→ form fields (required = enabled),multipart/form-data(binary-aware), XML (sampled viaschema.xml.name),text/plain, raw fallback; Swagger 2formData/bodyparams honoringconsumes.Import from URL
importFromUrl: spec fetched through the engine sidecar (no CORS), then the regular auto-detect pipeline. ImportModal gains Paste | URL | File tabs; a bare URL pasted into the textarea is detected and fetched.OpenAPI 3.1 tolerance
type: ["string","null"]arrays,const,examplesarrays, friendly error for webhooks-only documents.Schema additions (backward-compatible zod defaults)
RequestDefinition.description/.deprecated;FolderConfig.description.Tests
pnpm -r checkclean, 449 tests passing across the monorepo.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.