-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(go): allow multiple schemas using picoschema #1400
base: main
Are you sure you want to change the base?
Conversation
please follow https://www.conventionalcommits.org/en/v1.0.0/ for PRs |
@@ -97,3 +100,54 @@ func replaceEmptySchemas(m map[string]any) any { | |||
} | |||
return m | |||
} | |||
|
|||
func replaceAnyOfWithTypeArray(schema map[string]any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you help me understand what this is for? Is it only needed for the test or everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that it is a helper function, to match exactly the test cases with the string expected, without it we have error because the serializate func outputs something like string("red", "blue")
and we want AnyOf("red", "blue")
, but the important refactor I think it is about: picoschema.go https://github.com/firebase/genkit/pull/1400/files#diff-d643807a9a75f3e4805fd792bbd253ad99819a506fcfb5bdf9ffa20660d87a4eR109
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a sample with an actual dotprompt file that uses these features that weren't supported before? The tests are good but we're doing quite a bit of extra logic here so I want to make sure that it actually works in practice. There's a lot happening here so it's hard for me to tell if this is correct or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like dotpromot have now his own project,
Allow multiple type in picoschema
Checklist (if applicable):