Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

should complain when collections are not arrays #12

Closed
apsoto opened this Issue · 2 comments

2 participants

@apsoto

This is a bug in my API that I discovered when I returned only a direct entity instead an array with one item in the entities collection.

This ticket is just documenting that bbSiren should log an error when any of the collections (entities, links, actions) is NOT an array?

@uglymunky
Owner

Yeah, I've gone back and forth on how much validation backbone.siren should be doing. So far I've only logged warnings if something is bad enough to cause serious breakages. Here are all the current warnings in backbone.siren core:

warn('Action is missing a name, unable to add top level method', action);
warn('Missing href or "self" link');
warn('Action is missing a name, unable to add top level method', action);

At the same time I don't feel strongly about this and I haven't really put much thought into what would constitute a serious enough problem to merit validating to the siren spec.

@uglymunky
Owner

Going to leave this as a job for a separate "siren validator" should there ever be one.

@uglymunky uglymunky closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.