chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
13.36k stars 1.14k forks source link

[CLN] Get API generation working again #2381

Open AlabasterAxe opened 1 week ago

AlabasterAxe commented 1 week ago

Description of changes

The API generator would consistently fail for me when attempting to process "const" declarations. I found a workaround which is to re-write references to anyOf const objects as an enum of strings.

We were already lightly processing the openapi.json file in the shell script before but I've moved that logic into a TS script which makes it easier to do more complex transformations. I stopped short of reimplementing all of the logic in TS and just do an exec at the end of the TS code. To avoid confusion about the relationship of the files, I opted to move the shell code into a string constant in the TS script.

Test plan

Documentation Changes

No changes necessary.

github-actions[bot] commented 1 week ago

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation