Expected Behavior

Be able to generate more complex schemas with the BeanOutputConverter class, for instance with constrains definitions like max elements in array and max or min length for strings. This can be handled adding support to the definition of what modules should be loaded for jsonschema-generator library. Could be allowing override the private method generateSchema or adding it as a constructor parameter.

Current Behavior

Right now the BeanOutputConverter is adding just the jackson-module to the configuration of jsonschema-generator library, this is a great starting point to have a schema definition but does not allow the definition of more complex scenarios. The code to generate the value for jsonSchema field is private so we cannot override it to adding more modules to the libray.

Context

Under some circumstances we can ask to the AI model to generate content with specific rules, for instance if we want to generate specific number of answers for one question. In that case we can specify it with the prompt but probably could be a good idea add it as a constraint to the expected schema just to be sure the AI model respect it. This can be handled with the maven library jsonschema-module-jakarta-validation. I tested locally and just add it to the jsonschema-generator library configuration it's enough to add constraints to the generated schema.