Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generate models required for specific operations in REST API #1521

Closed
srnagar opened this issue Jun 22, 2022 · 3 comments
Closed

Generate models required for specific operations in REST API #1521

srnagar opened this issue Jun 22, 2022 · 3 comments
Assignees
Labels
design-discussion An area of design currently under discussion and open to team and community feedback. DPG/RLC August MVP DPG/RLC v2.0b1

Comments

@srnagar
Copy link
Member

srnagar commented Jun 22, 2022

Design for specifying operations/operation groups that need models. The generator should include only models that are needed by the specified operations in public package. The generator, however, may decide to generate all models in implementation package.

@srnagar srnagar added design-discussion An area of design currently under discussion and open to team and community feedback. DPG/RLC v2.0b1 labels Jun 22, 2022
@weidongxu-microsoft
Copy link
Member

One issue is how to specify this in CADL. (assume we discard autorest and its md configs)

@weidongxu-microsoft weidongxu-microsoft self-assigned this Jul 22, 2022
@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Jul 22, 2022

For now, we will use a @convenienceMethod decorator on CADL operation, or on interface (group of multiple operations).

Then related model will get usage: convenience-method populated to all model/enum. And template will only write these models.

@weidongxu-microsoft
Copy link
Member

#1670

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
design-discussion An area of design currently under discussion and open to team and community feedback. DPG/RLC August MVP DPG/RLC v2.0b1
Projects
None yet
Development

No branches or pull requests

3 participants