Skip to content
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

Auto generated model for write operation #132

Closed
Tracked by #72
tadelesh opened this issue Jan 16, 2024 · 1 comment
Closed
Tracked by #72

Auto generated model for write operation #132

tadelesh opened this issue Jan 16, 2024 · 1 comment

Comments

@tadelesh
Copy link
Member

When using typespec-autorest emitter, it seems the emitter will auto split a model into read model and update model if any properties has only read visibility. This seems to be a discrepancy between the swagger and the tsp which will cause breaking change. I wonder if it is by design?
e.g.: tsp: https://github.com/Azure/azure-rest-api-specs/blob/9ab4f198f6fe5a803e092919168fb1053ce67260/specification/elasticsan/ElasticSan.Management/models.tsp#L276 swagger: https://github.com/Azure/azure-rest-api-specs/blob/9ab4f198f6fe5a803e092919168fb1053ce67260/specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/elasticsan.json#L2279

@tadelesh tadelesh changed the title Auto generated model for custom patch template Auto generated model for write template Jan 16, 2024
@tadelesh tadelesh changed the title Auto generated model for write template Auto generated model for write operation Jan 16, 2024
@markcowl
Copy link
Member

markcowl commented Jan 16, 2024

This is by design as far as the template is concerned. There is q workaround for brownfield APIs to use the 'parameterVisibility' decorator for the operation, set to no visibility, if the entire resource is used as the PATCH input. This would be used in conjunction with the ArmCustomPatch* templates, or a lower level representation. e.g. this playground

Meanwhile, progress on a new template is blocked by this design issue: https://github.com/Azure/typespec-azure-pr/issues/3413

@markcowl markcowl self-assigned this Jan 16, 2024
@markcowl markcowl removed their assignment Jan 17, 2024
@markcowl markcowl added this to the [2024] March milestone Jan 17, 2024
@tadelesh tadelesh removed the Blocking label Jan 25, 2024
@markcowl markcowl closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants