title: Validating Avro schema that is referencing another schema
body: <p>I am using the Python 3 avro_validator library.</p>
  <p>The schema I want to validate references other schemas in sperate avro files. The files are in the same folder. How do I compile all the referenced schemas using the library?</p>
  <p>Python code as follows:</p>
  <pre><code>from avro_validator.schema import Schema
  
  schema_file = 'basketEvent.avsc'
  
  schema = Schema(schema_file)
  parsed_schema = schema.parse()
  
  data_to_validate = {&quot;test&quot;: &quot;test&quot;}
  
  parsed_schema.validate(data_to_validate)
  </code></pre>
  <p>The error I get back:</p>
  <pre><code>ValueError: Error parsing the field [contentBasket]: The type [ContentBasket] is not recognized by Avro
  </code></pre>
  <p>And example Avro file(s) below:</p>
  <pre><code>
  basketEvent.avsc 
  
  {
    &quot;type&quot;: &quot;record&quot;,
    &quot;name&quot;: &quot;BasketEvent&quot;,
    &quot;doc&quot;: &quot;Indicates that a user action has taken place with a basket&quot;,
    &quot;fields&quot;: [
      {
        &quot;default&quot;: &quot;basket&quot;,
        &quot;doc&quot;: &quot;Restricts this event to having type = basket&quot;,
        &quot;name&quot;: &quot;event&quot;,
        &quot;type&quot;: {
          &quot;name&quot;: &quot;BasketEventType&quot;,
          &quot;symbols&quot;: [&quot;basket&quot;],
          &quot;type&quot;: &quot;enum&quot;
        }
      },
      {
        &quot;default&quot;: &quot;create&quot;,
        &quot;doc&quot;: &quot;What is being done with the basket. Note: create / delete / update will always follow a product event&quot;,
        &quot;name&quot;: &quot;action&quot;,
        &quot;type&quot;: {
          &quot;name&quot;: &quot;BasketEventAction&quot;,
          &quot;symbols&quot;: [&quot;create&quot;,&quot;delete&quot;,&quot;update&quot;,&quot;view&quot;],
          &quot;type&quot;: &quot;enum&quot;
        }
      },
      {
        &quot;default&quot;: &quot;ContentBasket&quot;,
        &quot;doc&quot;: &quot;The set of values that are specific to a Basket event&quot;,
        &quot;name&quot;: &quot;contentBasket&quot;,
        &quot;type&quot;: &quot;ContentBasket&quot;
      },
      {
        &quot;default&quot;: &quot;ProductDetail&quot;,
        &quot;doc&quot;: &quot;The set of values that are specific to a Product event&quot;,
        &quot;name&quot;: &quot;productDetail&quot;,
        &quot;type&quot;: &quot;ProductDetail&quot;
      },
      {
        &quot;default&quot;: &quot;Timestamp&quot;,
        &quot;doc&quot;: &quot;The time stamp for the event being sent&quot;,
        &quot;name&quot;: &quot;timestamp&quot;,
        &quot;type&quot;: &quot;Timestamp&quot;
      }
    ]
  }
  
  </code></pre>
  <p>contentBasket.avsc</p>
  <pre><code>{
    &quot;name&quot;: &quot;ContentBasket&quot;,
    &quot;type&quot;: &quot;record&quot;,
    &quot;doc&quot;: &quot;The set of values that are specific to a Basket event&quot;,
    &quot;fields&quot;: [
      {
        &quot;default&quot;: [],
        &quot;doc&quot;: &quot;A range of details about product / basket availability&quot;,
        &quot;name&quot;: &quot;availability&quot;,
        &quot;type&quot;: {
          &quot;type&quot;: &quot;array&quot;,
          &quot;items&quot;: &quot;Availability&quot;
        }
      },
      {
        &quot;default&quot;: [],
        &quot;doc&quot;: &quot;A range of care pland applicable to the basket&quot;,
        &quot;name&quot;: &quot;carePlan&quot;,
        &quot;type&quot;: {
          &quot;type&quot;: &quot;array&quot;,
          &quot;items&quot;: &quot;CarePlan&quot;
        }
      },
      {
        &quot;default&quot;: &quot;Category&quot;,
        &quot;name&quot;: &quot;category&quot;,
        &quot;type&quot;: &quot;Category&quot;
      },
      {
        &quot;default&quot;: &quot;&quot;,
        &quot;doc&quot;: &quot;Unique identfier for this basket&quot;,
        &quot;name&quot;: &quot;id&quot;,
        &quot;type&quot;: &quot;string&quot;
      },
      {
        &quot;default&quot;: &quot;Price&quot;,
        &quot;doc&quot;: &quot;Overall pricing info about the basket as a whole - individual product pricings will be dealt with at a product level&quot;,
        &quot;name&quot;: &quot;price&quot;,
        &quot;type&quot;: &quot;Price&quot;
      }
    ]
  }
  </code></pre>
  <p>availability.avsc</p>
  <pre><code>{
    &quot;name&quot;: &quot;Availability&quot;,
    &quot;type&quot;: &quot;record&quot;,
    &quot;doc&quot;: &quot;A range of values relating to the availability of a product&quot;,
    &quot;fields&quot;: [
      {
        &quot;default&quot;: [],
        &quot;doc&quot;: &quot;A list of offers associated with the overall basket - product level offers will be dealt with on an individual product basis&quot;,
        &quot;name&quot;: &quot;shipping&quot;,
        &quot;type&quot;: {
          &quot;type&quot;: &quot;array&quot;,
          &quot;items&quot;: &quot;Shipping&quot;
        }
      },
      {
        &quot;default&quot;: &quot;&quot;,
        &quot;doc&quot;: &quot;The status of the product&quot;,
        &quot;name&quot;: &quot;stockStatus&quot;,
        &quot;type&quot;: {
          &quot;name&quot;: &quot;StockStatus&quot;,
          &quot;symbols&quot;: [&quot;in stock&quot;,&quot;out of stock&quot;,&quot;&quot;],
          &quot;type&quot;: &quot;enum&quot;
        }
      },
      {
        &quot;default&quot;: &quot;&quot;,
        &quot;doc&quot;: &quot;The ID for the store when the stock can be collected, if relevant&quot;,
        &quot;name&quot;: &quot;storeId&quot;,
        &quot;type&quot;: &quot;string&quot;
      },
      {
        &quot;default&quot;: &quot;&quot;,
        &quot;doc&quot;: &quot;The status of the product&quot;,
        &quot;name&quot;: &quot;type&quot;,
        &quot;type&quot;: {
          &quot;name&quot;: &quot;AvailabilityType&quot;,
          &quot;symbols&quot;: [&quot;collection&quot;,&quot;shipping&quot;,&quot;&quot;],
          &quot;type&quot;: &quot;enum&quot;
        }
      }
    ]
  }
  </code></pre>
  <p>maxDate.avsc</p>
  <pre><code>{
    &quot;type&quot;: &quot;record&quot;,
    &quot;name&quot;: &quot;MaxDate&quot;,
    &quot;doc&quot;: &quot;Indicates the timestamp for latest day a delivery should be made&quot;,
    &quot;fields&quot;: [
      {
        &quot;default&quot;: &quot;Timestamp&quot;,
        &quot;doc&quot;: &quot;The time stamp for the delivery&quot;,
        &quot;name&quot;: &quot;timestamp&quot;,
        &quot;type&quot;: &quot;Timestamp&quot;
      }
    ]
  }
  </code></pre>
  <p>minDate.avsc</p>
  <pre><code>{
    &quot;type&quot;: &quot;record&quot;,
    &quot;name&quot;: &quot;MinDate&quot;,
    &quot;doc&quot;: &quot;Indicates the timestamp for earliest day a delivery should be made&quot;,
    &quot;fields&quot;: [
      {
        &quot;default&quot;: &quot;Timestamp&quot;,
        &quot;doc&quot;: &quot;The time stamp for the delivery&quot;,
        &quot;name&quot;: &quot;timestamp&quot;,
        &quot;type&quot;: &quot;Timestamp&quot;
      }
    ]
  }
  </code></pre>
  <p>shipping.avsc</p>
  <pre><code>{
    &quot;name&quot;: &quot;Shipping&quot;,
    &quot;type&quot;: &quot;record&quot;,
    &quot;doc&quot;: &quot;A range of values relating to shipping a product for delivery&quot;,
    &quot;fields&quot;: [
      {
        &quot;default&quot;: &quot;MaxDate&quot;,
        &quot;name&quot;: &quot;maxDate&quot;,
        &quot;type&quot;: &quot;MaxDate&quot;
      },
      {
        &quot;default&quot;: &quot;MinDate&quot;,
        &quot;name&quot;: &quot;minDate&quot;,
        &quot;type&quot;: &quot;minDate&quot;
      },
      {
        &quot;default&quot;: 0,
        &quot;doc&quot;: &quot;Revenue generated from shipping - note, once a specific shipping object is selected, the more detailed revenye data sits within the one of object in pricing - this is more just to define if shipping is free or not&quot;,
        &quot;name&quot;: &quot;revenue&quot;,
        &quot;type&quot;: &quot;int&quot;
      },
      {
        &quot;default&quot;: &quot;&quot;,
        &quot;doc&quot;: &quot;The shipping supplier&quot;,
        &quot;name&quot;: &quot;supplier&quot;,
        &quot;type&quot;: &quot;string&quot;
      }
    ]
  }
  
  </code></pre>
  <p>timestamp.avsc</p>
  <pre><code>{
    &quot;name&quot;: &quot;Timestamp&quot;,
    &quot;type&quot;: &quot;record&quot;,
    &quot;doc&quot;: &quot;Timestamp for the action taking place&quot;,
    &quot;fields&quot;: [
      {
        &quot;default&quot;: 0,
        &quot;name&quot;: &quot;timestampMs&quot;,
        &quot;type&quot;: &quot;long&quot;
      },
      {
        &quot;default&quot;: &quot;&quot;,
        &quot;doc&quot;: &quot;Timestamp converted to a string in ISO format&quot;,
        &quot;name&quot;: &quot;isoTimestamp&quot;,
        &quot;type&quot;: &quot;string&quot;
      }
    ]
  }
  </code></pre>