fromJson

fun fromJson(source: String): Spec

Decodes a Spec from spec JSON — the inverse of toJson.

Return

the decoded Spec.

Parameters

source

spec JSON text.


fun fromJson(source: <Error class: unknown class>): Spec

Decodes a Spec from an already-parsed spec-JSON object.

The path for callers that produced the document as a tree rather than text — the directive resolver, or anything re-decoding after a state change — where serialising back to a string only to reparse it would be pure overhead.

Return

the decoded Spec.

Parameters

source

the spec-JSON root object.