function validateOneOfIsNotUsedWithUnsupportedConstraints(context) {
  // oneOf can be used like the following:
  //
  //   oneOf:
  //     - ...
  //     - ...
  //   ...
  //
  // where its effectively a combination of "one of these two constraints"
  // and "also these other constraits" which is effectively:
  //
  //   allOf:
  //     - oneOf:
  //         - ...
  //         - ...
  //      - ...
  //
  // API Element's doesn't have a way to support `allOf` and thus using
  // `oneOf` alongside other constraints is unsupported.
  //
  // We can allow annotations and (nullable as that is simple to support).

  // is a JSON Schema annotation (not constraint)
  const isAnnotation = R.anyPass([
    hasKey('title'),
    hasKey('description'),
    hasKey('default'),
    hasKey('example'),
  ]);

  const createUnsupportedWithOneOfWarning = member => createWarning(context.namespace,
    `'${name}' has limited support for 'oneOf', use of '${member.key.toValue()}' with 'oneOf' is not supported`,
    member.key);

  const parseMember = R.cond([
    [hasKey('oneOf'), R.identity],
    [hasKey('nullable'), R.identity],
    [isAnnotation, R.identity],
    [R.T, createUnsupportedWithOneOfWarning],
  ]);

  return parseObject(context, name, parseMember);
}
// Warns if oneOf is used with other unsupported constraints
Warns if oneOf is used with other unsupported constraints
Warns if oneOf is used with other unsupported constraints
function validateOneOfIsNotUsedWithUnsupportedConstraints(context) {
     oneOf:
       - ...
       - ...
     ...
   where its effectively a combination of "one of these two constraints"
   and "also these other constraits" which is effectively:
     allOf:
       - oneOf:
           - ...
           - ...
        - ...
   API Element's doesn't have a way to support `allOf` and thus using
   `oneOf` alongside other constraints is unsupported.
   We can allow annotations and (nullable as that is simple to support).
   is a JSON Schema annotation (not constraint)
  const isAnnotation = R.anyPass([
    hasKey('title'),
    hasKey('description'),
    hasKey('default'),
    hasKey('example'),
  ]);
  const createUnsupportedWithOneOfWarning = member => createWarning(context.namespace,
    `'${name}' has limited support for 'oneOf', use of '${member.key.toValue()}' with 'oneOf' is not supported`,
    member.key);
  const parseMember = R.cond([
    [hasKey('oneOf'), R.identity],
    [hasKey('nullable'), R.identity],
    [isAnnotation, R.identity],
    [R.T, createUnsupportedWithOneOfWarning],
  ]);
  return parseObject(context, name, parseMember);
}
function validateOneOfIsNotUsedWithUnsupportedConstraints ( context ) { const isAnnotation = R . anyPass ( [ hasKey ( 'title' ) , hasKey ( 'description' ) , hasKey ( 'default' ) , hasKey ( 'example' ) , ] ) ; const createUnsupportedWithOneOfWarning = member => createWarning ( context . namespace , ` ${ name } ${ member . key . toValue ( ) } ` , member . key ) ; const parseMember = R . cond ( [ [ hasKey ( 'oneOf' ) , R . identity ] , [ hasKey ( 'nullable' ) , R . identity ] , [ isAnnotation , R . identity ] , [ R . T , createUnsupportedWithOneOfWarning ] , ] ) ; return parseObject ( context , name , parseMember ) ; }
Warns if oneOf is used with other unsupported constraints
Warns if oneOf is used with other unsupported constraints
// oneOf can be used like the following: // //   oneOf: //     - ... //     - ... //   ... // // where its effectively a combination of "one of these two constraints" // and "also these other constraits" which is effectively: // //   allOf: //     - oneOf: //         - ... //         - ... //      - ... // // API Element's doesn't have a way to support `allOf` and thus using // `oneOf` alongside other constraints is unsupported. // // We can allow annotations and (nullable as that is simple to support). // is a JSON Schema annotation (not constraint)