title: How to represent union types in JSON schema validator?
body: <p>I am new to JSON schema validation and I am building a custom schema for a configuration. The schema I am building is based on a Typescript type. I understand how I can validate simple datatypes like array, object, number, string etc. </p>
  
  <p>But is there a way to specify types like this: </p>
  
  <pre><code>type Conf = {
  idle_session_timeout?: number | "none",
  item: {
      kind: "attribute";
      name: string;
  } | {
      kind: "relation";
      name: string;
  } | {
      kind: "group";
      name: string;
      label?: string | undefined;
      entries: PresentationItem[];
  }
   order_by: string | {
      attribute: string;
      direction?: "asc" | "desc" | undefined;
  }
  }
  </code></pre>
  
  <p>I noticed from <a href="http://json-schema.org/draft-07/schema" rel="nofollow noreferrer">http://json-schema.org/draft-07/schema</a> that it supports if then else statements to switch validation schema based on the value, but I don't know how to implement them. </p>