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 anyOfconst 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
[x] I've generated the client libraries locally using the script pnpm genapi
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 anenum
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
pnpm genapi
Documentation Changes
No changes necessary.