Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
14 stars 40 forks source link

[tcgc] TCGC linter rule `conflicting-multipart-model-usage` does not work in multiple content-type #387

Open chunyu3 opened 7 months ago

chunyu3 commented 7 months ago

conflicting-multipart-model-usage rule is to avoid a model both be used in multipart an other content-type.

But When we define an operation with multiple content-type, the linter ruler does not work. e.g. we defined a multiple content-type operation as following, TCGC does not report conflicting-multipart-model-usage error.

If the rule is to make sure a model cannot both used in multipart/form-data and other format, this multiple content-type scenario should not allow also.

op optionalDateTime(@header contentType: "multipart/form-data"|"application/json", @body body: TestModel): void;
iscai-msft commented 3 months ago

Is this a valid service scenario? @johanste