public function parse($source)
    {
        $resolver = new RefResolver();

        if ($this->connection !== null) {
            $resolver->addResolver('schema', new Resolver($this->connection));
        }

        $parser = new JsonSchema(null, $resolver);
        $schema = $parser->parse($source);

        return Service\Schema::serializeCache($schema);
    }