whitlockjc / json-refs

Various utilities for JSON Pointers (http://tools.ietf.org/html/rfc6901) and JSON References (http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript definitions for `resolveRefsAt` are invalid

oleg-codaio opened this issue · comments

resolveRefsAt returns Promise<RetrievedResolvedRefsResults> when it should be returning the same as Promise<ResolvedRefsResults>. The types are incorrect because it actually returns {resolved} and not {value}.

Context: #139 (comment)

Based on the RetrievedResolvedRefsResults, it looks like JsonRefs.resolveRefsAt is returning the appropriate value. resolveRefsAt is a superset of resolveRefs because it returns the original content of the document provided. I think the issue is that there is a typo where the resolved property for RetrievedResolvedRefsResults is missing causing the TypeScript generation to fail.

This is fixed in json-refs@v3.0.11.

That fix was incorrect.

Does this look better? I will wait to hear back from you before I push release.

Yeah, that looks better, thanks! I'm not sure about whether it can be an array (and if so, what it'd be an array of), but at least the type is consistent with that of the other methods.

Resolved in json-refs@3.0.12.