Skip to content

Commit f8dd322

Browse files
committed
get to a nicer state
1 parent 94d1f26 commit f8dd322

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

addon/-private/validate-relationships.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dasherize } from 'json-api-validations/-private/utils/dasherize';
1+
import { dasherize } from '@ember/string';
22
import { RELATIONSHIP_ERROR_TYPES, RelationshipError } from './errors/relationship-error';
33

44
export default function validateResourceRelationships(schema, relationships, methodName, path = '') {

addon/-private/validate-resource.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { dasherize } from 'json-api-validations/-private/utils/dasherize';
1+
/*
2+
import { dasherize } from '@ember/string';
23
import validateResourceRelationships from './validate-relationships';
34
import validateResourceAttributes from './validate-attributes';
4-
import coalesceAndThrowErrors from './coalesce-errors';
55
import { RESOURCE_ERROR_TYPES, ResourceError } from './errors/resource-error';
66
77
const _EXPECTED_RESOURCE_KEYS = [
@@ -13,10 +13,22 @@ const _MANDATORY_PRIMARY_RESOURCE_KEYS = [
1313
const _MANDATORY_SECONDARY_RESOURCE_KEYS = [
1414
'attributes', 'relationships'
1515
];
16-
17-
export default function validateResource(resource, methodName, path) {
18-
let errors = [];
19-
16+
*/
17+
18+
/**
19+
*
20+
* @param validator
21+
* @param document
22+
* @param issues
23+
* @param target
24+
* @param path
25+
*/
26+
export default function validateResource(/*{ validator, document, issues, target, path }*/) {
27+
28+
// TODO don't early return;
29+
return true;
30+
31+
/*
2032
if (!resource) {
2133
errors.push(new ResourceError(RESOURCE_ERROR_TYPES.RESOURCE_MISSING, undefined, undefined, resource, path));
2234
@@ -31,9 +43,10 @@ export default function validateResource(resource, methodName, path) {
3143
errors = errors.concat(detectTypeErrors(resource, methodName, path));
3244
}
3345
34-
coalesceAndThrowErrors(errors);
46+
*/
3547
}
3648

49+
/*
3750
function detectStructuralErrors(payload, methodName, path) {
3851
let resourceKeys = Object.keys(payload);
3952
let errors = [];
@@ -104,3 +117,4 @@ function detectTypeErrors(resource, methodName, path) {
104117
105118
return errors;
106119
}
120+
*/

tests/unit/invalid-document-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ module('Unit | Document', function(hooks) {
426426
);
427427
});
428428

429-
test('MAY contain meta', function(assert) {
430-
429+
todo('MAY contain meta', function(assert) {
430+
assert.notOk('Not Implemented');
431431
});
432-
test('MUST NOT contain other members', function(assert) {
433-
432+
todo('MUST NOT contain other members', function(assert) {
433+
assert.notOk('Not Implemented');
434434
});
435435
});
436436

0 commit comments

Comments
 (0)