|
1 |
| -/* eslint-disable no-unused-vars */ |
2 | 1 | const R = require('ramda');
|
3 | 2 | const {
|
4 | 3 | isExtension, hasKey, getValue,
|
@@ -37,17 +36,17 @@ function parseOauthFlowsObject(context, object) {
|
37 | 36 | const parseFlow = (member) => {
|
38 | 37 | const key = member.key.toValue();
|
39 | 38 |
|
40 |
| - const needAuthorizationUrl = flow => R.includes(key, ['implicit', 'authorizationCode']); |
41 |
| - const needTokenUrl = flow => R.includes(key, ['password', 'clientCredentials', 'authorizationCode']); |
| 39 | + const needAuthorizationUrl = () => R.includes(key, ['implicit', 'authorizationCode']); |
| 40 | + const needTokenUrl = () => R.includes(key, ['password', 'clientCredentials', 'authorizationCode']); |
42 | 41 |
|
43 | 42 | const hasAuthorizationUrl = flow => flow.get('authorizationUrl');
|
44 | 43 | const hasTokenUrl = flow => flow.get('tokenUrl');
|
45 | 44 |
|
46 | 45 | const parse = pipeParseResult(namespace,
|
47 | 46 | R.compose(parseOauthFlowObject(context), getValue),
|
48 |
| - R.when(R.allPass([R.complement(hasAuthorizationUrl), needAuthorizationUrl]), flow => createWarning(namespace, |
| 47 | + R.when(R.allPass([R.complement(hasAuthorizationUrl), needAuthorizationUrl]), () => createWarning(namespace, |
49 | 48 | `'${name}' '${key}' is missing required property 'authorizationUrl'`, member)),
|
50 |
| - R.when(R.allPass([R.complement(hasTokenUrl), needTokenUrl]), flow => createWarning(namespace, |
| 49 | + R.when(R.allPass([R.complement(hasTokenUrl), needTokenUrl]), () => createWarning(namespace, |
51 | 50 | `'${name}' '${key}' is missing required property 'tokenUrl'`, member)));
|
52 | 51 |
|
53 | 52 | return parse(member);
|
|
0 commit comments