Azure / autorest.csharp

Extension for AutoRest (https://github.com/Azure/autorest) that generates C# code
MIT License
141 stars 166 forks source link

Remove properties that have a visibility that we don't know about. #4177

Open m-nash opened 7 months ago

m-nash commented 7 months ago

There are a set of known visibilities from typespec https://github.com/microsoft/typespec/blob/31863054269264dbba0eb8d379089eb97ba86b06/packages/http/src/metadata.ts#L31.

Our strategy today is we honor Read by making a property not have a setter and the rest we do nothing special with.

Since visibility takes an unbounded string we might come across things that are completely independent of clients like gateway or database type stuff.

In this case we should omit those properties from the model.

I think the way we want to approach this is if you are not in the known http set of visibilities then we will drop the property and not emit it into the model.

lirenhe commented 7 months ago

@m-nash, shall we just report error for this unknown property instead of removing this property from the model?