go-openai
go-openai copied to clipboard
Add support for 'enum' tag to JSON schema generation
This pull request includes enhancements to the jsonschema package, specifically adding support for enumerations in schema definitions and improving the test coverage for schema generation and comparison.
Enhancements to schema generation:
jsonschema/json.go: Added support for parsingenumtags in struct fields and including them in the generated schema. [1] [2]
Improvements to test coverage:
jsonschema/json_test.go: Added new tests to verify schema generation for types withenumtags and to compare struct-generated schemas with manually created schemas.jsonschema/json_test.go: Updated existing tests to remove unnecessarypropertiesfields from the expected JSON output. [1] [2] [3] [4] [5]