Skip to content

Commit

Permalink
explain single examples limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Jan 5, 2024
1 parent e120ff2 commit f73b56b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ pub fn get_schema(topic: &str, version: Option<u16>) -> Result<Schema, SchemaErr
let s = serde_json::from_str(schema).map_err(|_| SchemaError::InvalidSchema)?;
let compiled_json_schema = JSONSchema::compile(&s).map_err(|_| SchemaError::InvalidSchema)?;

// FIXME(swatinem): This assumes that there is only a single examples directory
// FIXME(swatinem): This assumes that there is only a single `examples` entry in the definition.
// If we would want to support multiple, we would have to either merge those in code generation,
// or rather use a `fn examples() -> impl Iterator`.
let examples = schema_metadata
.examples
.first()
Expand Down

0 comments on commit f73b56b

Please sign in to comment.