Supported Formats
Xolo’sOpenApiService accepts OpenAPI v3 JSON (the openapi key) and Swagger 2.0 JSON (the swagger key). The spec must be a valid JSON object containing:
info.title— becomes the root collection name (falls back to"Imported Collection"if absent)paths— the map of endpoint definitions
ImportManager.detectFormat() identifies an OpenAPI file automatically by looking for an openapi or swagger top-level key, so the format picker can stay on Auto-detect.
Import from URL
1
Open the Import dialog
Tap the sidebar menu → Import → Collection. The
ImportCollectionDialog opens. Ensure the source toggle is set to URL and the format is set to Auto-detect or OpenAPI.2
Enter the spec URL
Type or paste the full URL of the OpenAPI JSON spec, for example:Xolo uses
Dio to fetch the spec over HTTP/HTTPS.3
Xolo fetches and parses the spec
OpenApiService.importFromUrl() issues a GET request to the URL, validates that the response is a Map<String, dynamic>, then calls importFromJson() internally to build the collection tree.4
A collection is created
Xolo creates a root collection named after
info.title. Requests are grouped into sub-collections by tag. Every path–method combination becomes a saved request under its tag folder. The sidebar refreshes automatically.Import from File
1
Switch to File source
In the
ImportCollectionDialog, switch the source toggle to File.2
Select the spec file
Tap Select file. The file picker opens filtered to
.json, .yaml, and .yml extensions. Select your local OpenAPI JSON file.3
Import
Tap Import Now. Xolo reads the file bytes, decodes them as UTF-8, calls
ImportManager.importFromContent(), and the resulting collection appears in the sidebar.Generated Request Structure
OpenApiService._parseAndSave() iterates over every paths entry and every HTTP method within it. The logic skips the pseudo-keys parameters, summary, and description so only real method entries produce requests.
Tag-based grouping
Endpoints that share the same first tag are placed in the same sub-collection folder. Xolo upserts tag folders — if a folder with the same name already exists under the root collection, it is reused rather than duplicated.OpenApiService Reference
importFromUrl
importFromJson
_parseAndSave() pipeline. importFromUrl adds an HTTP GET fetch step before calling importFromJson.
SchemaHelper — Pre-populated Request Bodies
The import pipeline usesSchemaHelper to turn schema objects into concrete sample payloads. Before writing the request, OpenApiService calls:
SchemaHelper.resolveSchema(schema, rootSpec)— walks$refpointers within the spec JSON to return a self-contained schema object.SchemaHelper.generateSample(resolvedSchema)— produces a sample value following this priority:examplefield →defaultfield →nullablenull →enumfirst value → recursive object/array generation fromproperties/items. The sample is pretty-printed with a 2-space indent and stored as the request body.
parameters[].in == "body" entry rather than a requestBody block.
Authentication schemes defined in the OpenAPI spec’s
securitySchemes or security blocks are not automatically imported. Configure authentication manually on the collection or individual requests using Xolo’s Auth tab after the import completes.