-
Notifications
You must be signed in to change notification settings - Fork 58
[WIP] flatten JSONModelType body properties as operation parameters #1623
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
Conversation
@changlong-liu i think this looks ok, can you show me what it generates in OpenAI before I merge? Thanks! |
Thanks @iscai-msft for review, generated code for OpenAI.Inference are uploaded at https://github.com/changlong-liu/autorest.python/tree/20221216-openai-flatten/packages/cadl-python/cadl-output/azure/openai, and the part related to this PR is at https://github.com/changlong-liu/autorest.python/blob/20221216-openai-flatten/packages/cadl-python/cadl-output/azure/openai/_operations/_operations.py#L107-L241 |
…into update_cadl * 'autorestv3' of https://github.com/Azure/autorest.python: Update CHANGELOG.md Update package.json Update ChangeLog.md use """ pair presenting enum item docs (#1655) [WIP] flatten JSONModelType body properties as operation parameters (#1623) [cadl-python] fix import and _vendor.py for subclient (#1649)
…into cadl_ranch_branch * 'autorestv3' of https://github.com/Azure/autorest.python: (53 commits) Fix publish (#1667) pip dev(deps-dev): bump pylint in /packages/autorest.python (#1664) Update package.json Update ChangeLog.md Update package.json Update CHANGELOG.md fix emitter for ADP (#1659) pip dev(deps-dev): bump pyright from 1.1.274 to 1.1.287 in /packages/autorest.python (#1653) have pipelines fail on regeneration failure (#1663) clean up cadl code with tim (#1657) Update CHANGELOG.md Update package.json Update ChangeLog.md use """ pair presenting enum item docs (#1655) [WIP] flatten JSONModelType body properties as operation parameters (#1623) [cadl-python] fix import and _vendor.py for subclient (#1649) pip prod(deps): bump m2r2 from 0.3.2 to 0.3.3 in /packages/autorest.python (#1644) pip prod(deps): bump platformdirs in /packages/autorest.python (#1641) pip prod(deps): bump pathspec in /packages/autorest.python (#1642) pip prod(deps): bump json-rpc in /packages/autorest.python (#1638) ...
For cadl:
Generate as:
The alias parameter in OpenAI cadl https://github.com/changlong-liu/autorest.python/blob/20221216-openai-flatten/packages/cadl-python/OpenAI.Inference/models/embeddings.create.cadl#L8-L23 is generated as
JSON body+ flattened properties
: https://github.com/changlong-liu/autorest.python/blob/20221216-openai-flatten/packages/cadl-python/cadl-output/azure/openai/_operations/_operations.py#L107-L241