ApiSpec

@Serializable
data class ApiSpec(val id: String, val name: String, val servers: List<String>, val operations: List<Operation>, val delayMs: Long? = null)

The parsed contents of a single OpenAPI 3.x document — one spec file, one ApiSpec.

There is no environment axis: a running app talks to exactly one base URL at a time, so servers simply lists every base URL declared in the document's servers[] array, and a request matches this spec if its hostname matches any of them (see com.worldline.devview.networkmock.core.repository.MockConfigRepository.findMatchingMock). An OpenAPI document spanning multiple API versions (e.g. both /api/v1/... and /api/v2/... paths) is simply multiple Operation entries in the same spec — there is no separate version dimension in this type.

See also

Constructors

Link copied to clipboard
constructor(id: String, name: String, servers: List<String>, operations: List<Operation>, delayMs: Long? = null)

Properties

Link copied to clipboard

Spec-wide default response delay in milliseconds, from the document-root x-devview.delayMs extension (see #94). Falls back to null (no delay) when absent, and is itself overridden by Operation.delayMs when the operation declares its own.

Link copied to clipboard
val id: String

Stable identifier for this spec, slugified from info.title (e.g. "Sample API" → "sample-api"). Used as the response-file path prefix and in OperationKey.compositeKey.

Link copied to clipboard

Human-readable name displayed in the UI, taken verbatim from info.title.

Link copied to clipboard

The operations declared across all of this document's paths.

Link copied to clipboard

Base URLs declared in the document's servers[].url. A request matches this spec if its hostname matches any entry.