Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insufficient description of getBinary() params in lib-node #146

Open
hjelmevold opened this issue May 22, 2020 · 1 comment
Open

Insufficient description of getBinary() params in lib-node #146

hjelmevold opened this issue May 22, 2020 · 1 comment

Comments

@hjelmevold
Copy link
Member

The parameter binaryReference has a very sparse and confusing description:
https://developer.enonic.com/docs/xp/stable/api/lib-node#getbinary

In my mental model, the binaryReference param is exactly the same parameter as the name param in the corresponding getAttachmentStream() method in lib-content:
https://developer.enonic.com/docs/xp/stable/api/lib-content#getattachmentstream
…just that it's named differently between the two libraries. It would clean up some confusion if at least the descriptions matched in the documentation for both these methods, so people understand that they work in the same way.

Also, the doc for both of these methods could do well with some explanation of what exactly a stream is, and examples for when you'd use it (i.e. when you want to fill a response body with the contents of a file)

@sigdestad
Copy link
Member

Hi. No, they are not the same at all. Attatchments in content API is a thing for handling files, with a bunch of properties and metadata. It is also available as a separate attachmentLib. Binaryreference is a special properyType for storing byte arrays. That Said, there might well be room for improvement :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants