Skip to content

Released version 1.1.0

Latest

Choose a tag to compare

@dg dg released this 25 Oct 15:47
· 5 commits to master since this release
  • nette/schema support – setResponseSchema() and Tool::$parameters now accept an Expect::structure() or Expect::from() next to a JSON Schema array. You write the schema once in PHP, the library turns it into the shape each provider wants, and the answer comes back validated and cast: getJson() hands you an object, an array or an instance of your own class instead of a decoded array. nette/schema stays optional, a plain array works as before
  • Validated tool arguments – with an Expect schema for the parameters, arguments are checked before your handler runs, the model gets the exact validation messages to correct itself, and the handler receives the values with defaults filled in and casts applied
  • Schema problems caught early – a schema the provider would refuse (an optional key in strict mode, an open map, a tuple for Claude) is reported by setResponseSchema() right away instead of by the API on the first request; bounds Claude does not accept are left out of the wire and checked by getJson() instead
  • PHP 8.6 is supported