src/Reader.php
public static function readFromJson(string $json, string $baseType = OpenApi::class): SpecObjectInterface
    {
        return new $baseType(json_decode($json, true));
    }
public static function readFromJson(string $json, string $baseType = OpenApi::class): SpecObjectInterface
    {
        return new $baseType(json_decode($json, true));
    }
public static function readFromJson ( string $ json , string $ baseType = OpenApi :: class ) : SpecObjectInterface { return new $ baseType ( json_decode ( $ json , true ) ) ; }
Populate OpenAPI spec object from JSON data.
@param string $json the JSON string to decode.
@param string $baseType the base Type to instantiate. This must be an instance of [[SpecObjectInterface]].
The default is [[OpenApi]] which is the base type of a OpenAPI specification file.
You may choose a different type if you instantiate objects from sub sections of a specification.
@return SpecObjectInterface|OpenApi the OpenApi object instance.
@throws TypeErrorException in case invalid spec data is supplied.
Populate OpenAPI spec object from JSON data .