jsonapi-validator
jsonapi-validator copied to clipboard
Id member not required when resource object represents a new resource to be created on the server
Hi,
jsonapi-validator requires resources to have an id
https://github.com/elliotttf/jsonapi-validator/blob/master/lib/schema.json#L122
However, there is an exception to this rule in the JSON API specification (http://jsonapi.org/format/#document-resource-objects).
Exception: The id member is not required when the resource object originates at the client and represents a new resource to be created on the server.
Should jsonapi-validator be updated to take this case into account ?
Yes! This is an issue that should be fixed in jsonapi though. You can probably just take that schema and apply it directly.